E5XML/ProjectWriter.py

changeset 5100
2c193da9b94f
parent 5099
175b36822cc9
child 5389
9b1c800daff3
equal deleted inserted replaced
5099:175b36822cc9 5100:2c193da9b94f
51 if Preferences.getProject("XMLTimestamp"): 51 if Preferences.getProject("XMLTimestamp"):
52 self.writeComment( 52 self.writeComment(
53 " Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S'))) 53 " Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S')))
54 self.writeComment(" Copyright (C) {0} {1}, {2} ".format( 54 self.writeComment(" Copyright (C) {0} {1}, {2} ".format(
55 time.strftime('%Y'), 55 time.strftime('%Y'),
56 self.pdata["AUTHOR"][0], 56 self.pdata["AUTHOR"],
57 self.pdata["EMAIL"][0])) 57 self.pdata["EMAIL"]))
58 58
59 # add the main tag 59 # add the main tag
60 self.writeStartElement("Project") 60 self.writeStartElement("Project")
61 self.writeAttribute("version", projectFileFormatVersion) 61 self.writeAttribute("version", projectFileFormatVersion)
62 62
63 # do the language (used for spell checking) 63 # do the language (used for spell checking)
64 self.writeTextElement("Language", self.pdata["SPELLLANGUAGE"][0]) 64 self.writeTextElement("Language", self.pdata["SPELLLANGUAGE"])
65 if self.pdata["SPELLWORDS"]: 65 if self.pdata["SPELLWORDS"]:
66 self.writeTextElement( 66 self.writeTextElement(
67 "ProjectWordList", 67 "ProjectWordList",
68 Utilities.fromNativeSeparators(self.pdata["SPELLWORDS"])) 68 Utilities.fromNativeSeparators(self.pdata["SPELLWORDS"]))
69 if self.pdata["SPELLEXCLUDES"]: 69 if self.pdata["SPELLEXCLUDES"]:
70 self.writeTextElement( 70 self.writeTextElement(
71 "ProjectExcludeList", 71 "ProjectExcludeList",
72 Utilities.fromNativeSeparators(self.pdata["SPELLEXCLUDES"])) 72 Utilities.fromNativeSeparators(self.pdata["SPELLEXCLUDES"]))
73 73
74 # do the hash 74 # do the hash
75 self.writeTextElement("Hash", self.pdata["HASH"][0]) 75 self.writeTextElement("Hash", self.pdata["HASH"])
76 76
77 # do the programming language 77 # do the programming language
78 self.writeStartElement("ProgLanguage") 78 self.writeStartElement("ProgLanguage")
79 self.writeAttribute("mixed", str(int(self.pdata["MIXEDLANGUAGE"][0]))) 79 self.writeAttribute("mixed", str(int(self.pdata["MIXEDLANGUAGE"])))
80 self.writeCharacters(self.pdata["PROGLANGUAGE"][0]) 80 self.writeCharacters(self.pdata["PROGLANGUAGE"])
81 self.writeEndElement() 81 self.writeEndElement()
82 82
83 # do the UI type 83 # do the UI type
84 self.writeTextElement("ProjectType", self.pdata["PROJECTTYPE"][0]) 84 self.writeTextElement("ProjectType", self.pdata["PROJECTTYPE"])
85 85
86 # do description 86 # do description
87 if self.pdata["DESCRIPTION"]: 87 if self.pdata["DESCRIPTION"]:
88 self.writeTextElement("Description", self.pdata["DESCRIPTION"]) 88 self.writeTextElement("Description", self.pdata["DESCRIPTION"])
89 89
90 # do version, author and email 90 # do version, author and email
91 self.writeTextElement("Version", self.pdata["VERSION"]) 91 self.writeTextElement("Version", self.pdata["VERSION"])
92 self.writeTextElement("Author", self.pdata["AUTHOR"][0]) 92 self.writeTextElement("Author", self.pdata["AUTHOR"])
93 self.writeTextElement("Email", self.pdata["EMAIL"][0]) 93 self.writeTextElement("Email", self.pdata["EMAIL"])
94 94
95 # do the translation pattern 95 # do the translation pattern
96 if self.pdata["TRANSLATIONPATTERN"]: 96 if self.pdata["TRANSLATIONPATTERN"]:
97 self.writeTextElement( 97 self.writeTextElement(
98 "TranslationPattern", 98 "TranslationPattern",

eric ide

mercurial