42 """ |
42 """ |
43 while not self.atEnd(): |
43 while not self.atEnd(): |
44 self.readNext() |
44 self.readNext() |
45 if self.isStartElement(): |
45 if self.isStartElement(): |
46 if self.name() == "Project": |
46 if self.name() == "Project": |
47 self.version = \ |
47 self.version = self.attribute( |
48 self.attribute("version", projectFileFormatVersion) |
48 "version", projectFileFormatVersion) |
49 if self.version not in self.supportedVersions: |
49 if self.version not in self.supportedVersions: |
50 self.raiseUnsupportedFormatVersion(self.version) |
50 self.raiseUnsupportedFormatVersion(self.version) |
51 elif self.name() == "Language": |
51 elif self.name() == "Language": |
52 self.project.pdata["SPELLLANGUAGE"] = \ |
52 self.project.pdata["SPELLLANGUAGE"] = ( |
53 self.readElementText() |
53 self.readElementText() |
|
54 ) |
54 elif self.name() == "ProjectWordList": |
55 elif self.name() == "ProjectWordList": |
55 self.project.pdata["SPELLWORDS"] = \ |
56 self.project.pdata["SPELLWORDS"] = ( |
56 Utilities.toNativeSeparators(self.readElementText()) |
57 Utilities.toNativeSeparators(self.readElementText()) |
|
58 ) |
57 elif self.name() == "ProjectExcludeList": |
59 elif self.name() == "ProjectExcludeList": |
58 self.project.pdata["SPELLEXCLUDES"] = \ |
60 self.project.pdata["SPELLEXCLUDES"] = ( |
59 Utilities.toNativeSeparators(self.readElementText()) |
61 Utilities.toNativeSeparators(self.readElementText()) |
|
62 ) |
60 elif self.name() == "Hash": |
63 elif self.name() == "Hash": |
61 self.project.pdata["HASH"] = self.readElementText() |
64 self.project.pdata["HASH"] = self.readElementText() |
62 elif self.name() == "ProgLanguage": |
65 elif self.name() == "ProgLanguage": |
63 self.project.pdata["MIXEDLANGUAGE"] = \ |
66 self.project.pdata["MIXEDLANGUAGE"] = int( |
64 int(self.attribute("mixed", "0")) |
67 self.attribute("mixed", "0") |
|
68 ) |
65 self.project.pdata["PROGLANGUAGE"] = self.readElementText() |
69 self.project.pdata["PROGLANGUAGE"] = self.readElementText() |
66 if self.project.pdata["PROGLANGUAGE"] == "Python": |
70 if self.project.pdata["PROGLANGUAGE"] == "Python": |
67 # convert Python to the more specific Python2 |
71 # convert Python to the more specific Python2 |
68 self.project.pdata["PROGLANGUAGE"] = "Python2" |
72 self.project.pdata["PROGLANGUAGE"] = "Python2" |
69 elif self.name() == "ProjectType": |
73 elif self.name() == "ProjectType": |
75 elif self.name() == "Author": |
79 elif self.name() == "Author": |
76 self.project.pdata["AUTHOR"] = self.readElementText() |
80 self.project.pdata["AUTHOR"] = self.readElementText() |
77 elif self.name() == "Email": |
81 elif self.name() == "Email": |
78 self.project.pdata["EMAIL"] = self.readElementText() |
82 self.project.pdata["EMAIL"] = self.readElementText() |
79 elif self.name() == "TranslationPattern": |
83 elif self.name() == "TranslationPattern": |
80 self.project.pdata["TRANSLATIONPATTERN"] = \ |
84 self.project.pdata["TRANSLATIONPATTERN"] = ( |
81 Utilities.toNativeSeparators(self.readElementText()) |
85 Utilities.toNativeSeparators(self.readElementText()) |
|
86 ) |
82 elif self.name() == "TranslationsBinPath": |
87 elif self.name() == "TranslationsBinPath": |
83 self.project.pdata["TRANSLATIONSBINPATH"] = \ |
88 self.project.pdata["TRANSLATIONSBINPATH"] = ( |
84 Utilities.toNativeSeparators(self.readElementText()) |
89 Utilities.toNativeSeparators(self.readElementText()) |
|
90 ) |
85 elif self.name() == "Eol": |
91 elif self.name() == "Eol": |
86 self.project.pdata["EOL"] = \ |
92 self.project.pdata["EOL"] = int( |
87 int(self.attribute("index", "0")) |
93 self.attribute("index", "0") |
|
94 ) |
88 elif self.name() == "Sources": |
95 elif self.name() == "Sources": |
89 self.__readFiles("Sources", "Source", "SOURCES") |
96 self.__readFiles("Sources", "Source", "SOURCES") |
90 elif self.name() == "Forms": |
97 elif self.name() == "Forms": |
91 self.__readFiles("Forms", "Form", "FORMS") |
98 self.__readFiles("Forms", "Form", "FORMS") |
92 elif self.name() == "Translations": |
99 elif self.name() == "Translations": |
103 elif self.name() == "Protocols": |
110 elif self.name() == "Protocols": |
104 self.__readFiles("Protocols", "Protocol", "PROTOCOLS") |
111 self.__readFiles("Protocols", "Protocol", "PROTOCOLS") |
105 elif self.name() == "Others": |
112 elif self.name() == "Others": |
106 self.__readFiles("Others", "Other", "OTHERS") |
113 self.__readFiles("Others", "Other", "OTHERS") |
107 elif self.name() == "MainScript": |
114 elif self.name() == "MainScript": |
108 self.project.pdata["MAINSCRIPT"] = \ |
115 self.project.pdata["MAINSCRIPT"] = ( |
109 Utilities.toNativeSeparators(self.readElementText()) |
116 Utilities.toNativeSeparators(self.readElementText()) |
|
117 ) |
110 elif self.name() == "Vcs": |
118 elif self.name() == "Vcs": |
111 self.__readVcs() |
119 self.__readVcs() |
112 elif self.name() == "FiletypeAssociations": |
120 elif self.name() == "FiletypeAssociations": |
113 self.__readFiletypeAssociations() |
121 self.__readFiletypeAssociations() |
114 elif self.name() == "LexerAssociations": |
122 elif self.name() == "LexerAssociations": |