eric6/E5XML/ProjectReader.py

Sun, 02 Feb 2020 11:04:32 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 02 Feb 2020 11:04:32 +0100
changeset 7380
c99320e859ca
parent 7360
9190402e4505
child 7635
0cdead130a81
permissions
-rw-r--r--

Fixed an issue related to showing the application name in the menu bar of Gnome desktop under Wayland.

609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7253
diff changeset
3 # Copyright (c) 2010 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a class for reading an XML project file.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
10
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from .Config import projectFileFormatVersion
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from .XMLStreamReaderBase import XMLStreamReaderBase
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 import Utilities
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
16
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class ProjectReader(XMLStreamReaderBase):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 Class for reading an XML project file.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
6604
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
21 supportedVersions = ["4.6",
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
22 "5.0", "5.1",
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
23 "6.0", "6.1", "6.2", "6.3", "6.4"]
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 def __init__(self, device, project):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Constructor
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param device reference to the I/O device to read from (QIODevice)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param project Reference to the project object to store the
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 information into.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 XMLStreamReaderBase.__init__(self, device)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.project = project
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.version = ""
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 def readXML(self):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 Public method to read and parse the XML document.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 if self.name() == "Project":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
47 self.version = self.attribute(
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
48 "version", projectFileFormatVersion)
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 if self.version not in self.supportedVersions:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.raiseUnsupportedFormatVersion(self.version)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 elif self.name() == "Language":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
52 self.project.pdata["SPELLLANGUAGE"] = (
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
53 self.readElementText()
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
54 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 elif self.name() == "ProjectWordList":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
56 self.project.pdata["SPELLWORDS"] = (
5098
bc74f74a95f5 Started to clean up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
57 Utilities.toNativeSeparators(self.readElementText())
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
58 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 elif self.name() == "ProjectExcludeList":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
60 self.project.pdata["SPELLEXCLUDES"] = (
5098
bc74f74a95f5 Started to clean up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
61 Utilities.toNativeSeparators(self.readElementText())
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
62 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 elif self.name() == "Hash":
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
64 self.project.pdata["HASH"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 elif self.name() == "ProgLanguage":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
66 self.project.pdata["MIXEDLANGUAGE"] = int(
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
67 self.attribute("mixed", "0")
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
68 )
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
69 self.project.pdata["PROGLANGUAGE"] = self.readElementText()
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
70 if self.project.pdata["PROGLANGUAGE"] == "Python":
788
5b1b59777460 Added a feature where flags can be given at the end of a source file. The only flag supported is 'FileType' to overwrite the filetype detection mechanism.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 609
diff changeset
71 # convert Python to the more specific Python2
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
72 self.project.pdata["PROGLANGUAGE"] = "Python2"
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 elif self.name() == "ProjectType":
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
74 self.project.pdata["PROJECTTYPE"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 elif self.name() == "Description":
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
76 self.project.pdata["DESCRIPTION"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 elif self.name() == "Version":
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
78 self.project.pdata["VERSION"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 elif self.name() == "Author":
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
80 self.project.pdata["AUTHOR"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 elif self.name() == "Email":
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5099
diff changeset
82 self.project.pdata["EMAIL"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 elif self.name() == "TranslationPattern":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
84 self.project.pdata["TRANSLATIONPATTERN"] = (
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
85 Utilities.toNativeSeparators(self.readElementText())
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
86 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 elif self.name() == "TranslationsBinPath":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
88 self.project.pdata["TRANSLATIONSBINPATH"] = (
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
89 Utilities.toNativeSeparators(self.readElementText())
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
90 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 elif self.name() == "Eol":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
92 self.project.pdata["EOL"] = int(
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
93 self.attribute("index", "0")
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
94 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 elif self.name() == "Sources":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.__readFiles("Sources", "Source", "SOURCES")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 elif self.name() == "Forms":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.__readFiles("Forms", "Form", "FORMS")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 elif self.name() == "Translations":
2992
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
100 self.__readFiles(
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
101 "Translations", "Translation", "TRANSLATIONS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 elif self.name() == "TranslationExceptions":
2992
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
103 self.__readFiles(
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
104 "TranslationExceptions", "TranslationException",
dbdf27746da5 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
105 "TRANSLATIONEXCEPTIONS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 elif self.name() == "Resources":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.__readFiles("Resources", "Resource", "RESOURCES")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 elif self.name() == "Interfaces":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__readFiles("Interfaces", "Interface", "INTERFACES")
5969
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
110 elif self.name() == "Protocols":
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
111 self.__readFiles("Protocols", "Protocol", "PROTOCOLS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 elif self.name() == "Others":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.__readFiles("Others", "Other", "OTHERS")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 elif self.name() == "MainScript":
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
115 self.project.pdata["MAINSCRIPT"] = (
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
116 Utilities.toNativeSeparators(self.readElementText())
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
117 )
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 elif self.name() == "Vcs":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.__readVcs()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 elif self.name() == "FiletypeAssociations":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 self.__readFiletypeAssociations()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 elif self.name() == "LexerAssociations":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.__readLexerAssociations()
6251
02afc7d22c41 Introduced a new project file format version and added reader and writer support for the 'make' parameter set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6245
diff changeset
124 elif self.name() == "Make":
02afc7d22c41 Introduced a new project file format version and added reader and writer support for the 'make' parameter set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6245
diff changeset
125 self.__readBasicDataField(
02afc7d22c41 Introduced a new project file format version and added reader and writer support for the 'make' parameter set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6245
diff changeset
126 "Make", "MakeParameters", "MAKEPARAMS")
6439
86dd19e45d95 Project, ProjectInterfacesBrowser: started to implement some configuration capabilities for the IDL compiler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6251
diff changeset
127 elif self.name() == "IdlCompiler":
86dd19e45d95 Project, ProjectInterfacesBrowser: started to implement some configuration capabilities for the IDL compiler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6251
diff changeset
128 self.__readBasicDataField(
86dd19e45d95 Project, ProjectInterfacesBrowser: started to implement some configuration capabilities for the IDL compiler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6251
diff changeset
129 "IdlCompiler", "IdlCompilerParameters", "IDLPARAMS")
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6439
diff changeset
130 elif self.name() == "UicCompiler":
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6439
diff changeset
131 self.__readBasicDataField(
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6439
diff changeset
132 "UicCompiler", "UicCompilerParameters", "UICPARAMS")
6604
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
133 elif self.name() == "RccCompiler":
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
134 self.__readBasicDataField(
a73d553ef521 ProjectFormsBrowser: started implementing support for rcc compiler options
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6597
diff changeset
135 "RccCompiler", "RccCompilerParameters", "RCCPARAMS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 elif self.name() == "ProjectTypeSpecific":
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
137 self.__readBasicDataField(
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
138 "ProjectTypeSpecific", "ProjectTypeSpecificData",
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
139 "PROJECTTYPESPECIFICDATA")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 elif self.name() == "Documentation":
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
141 self.__readBasicDataField(
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
142 "Documentation", "DocumentationParams",
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
143 "DOCUMENTATIONPARMS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 elif self.name() == "Packagers":
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
145 self.__readBasicDataField(
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
146 "Packagers", "PackagersParams", "PACKAGERSPARMS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 elif self.name() == "Checkers":
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
148 self.__readBasicDataField(
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
149 "Checkers", "CheckersParams", "CHECKERSPARMS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 elif self.name() == "OtherTools":
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
151 self.__readBasicDataField(
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
152 "OtherTools", "OtherToolsParams", "OTHERTOOLSPARMS")
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.raiseUnexpectedStartTag(self.name())
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 self.showErrorMessage()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 def __readFiles(self, tag, listTag, dataKey):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 Private method to read a list of files.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 @param tag name of the list tag (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 @param listTag name of the list element tag (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 @param dataKey key of the project data element (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 if self.isEndElement() and self.name() == tag:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 break
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 if self.name() == listTag:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 self.project.pdata[dataKey].append(
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 Utilities.toNativeSeparators(self.readElementText()))
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.raiseUnexpectedStartTag(self.name())
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 def __readBasicDataField(self, tag, dataTag, dataKey):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 Private method to read a list of files.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 @param tag name of the list tag (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 @param dataTag name of the data tag (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 @param dataKey key of the project data element (string)
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 if self.isEndElement() and self.name() == tag:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 break
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 if self.name() == dataTag:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.project.pdata[dataKey] = self._readBasics()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.raiseUnexpectedStartTag(self.name())
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 def __readVcs(self):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 Private method to read the VCS info.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 if self.isEndElement() and self.name() == "Vcs":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 break
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 if self.name() == "VcsType":
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
208 self.project.pdata["VCS"] = self.readElementText()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 elif self.name() == "VcsOptions":
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
210 self.project.pdata["VCSOPTIONS"] = self._readBasics()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 elif self.name() == "VcsOtherData":
5099
175b36822cc9 Continued cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5098
diff changeset
212 self.project.pdata["VCSOTHERDATA"] = self._readBasics()
609
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 self.raiseUnexpectedStartTag(self.name())
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 def __readFiletypeAssociations(self):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 Private method to read the file type associations.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 if self.isEndElement() and self.name() == "FiletypeAssociations":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 break
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 if self.name() == "FiletypeAssociation":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 pattern = self.attribute("pattern", "")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 filetype = self.attribute("type", "OTHERS")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if pattern:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 self.project.pdata["FILETYPES"][pattern] = filetype
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 self.raiseUnexpectedStartTag(self.name())
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 def __readLexerAssociations(self):
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 Private method to read the lexer associations.
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 """
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 while not self.atEnd():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.readNext()
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 if self.isEndElement() and self.name() == "LexerAssociations":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 break
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 if self.isStartElement():
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 if self.name() == "LexerAssociation":
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 pattern = self.attribute("pattern", "")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 lexer = self.attribute("lexer")
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 if pattern:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 self.project.pdata["LEXERASSOCS"][pattern] = lexer
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 else:
463fc2891cbf Migrated the project handler to project reader and removed XML handling source no longer needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 self.raiseUnexpectedStartTag(self.name())

eric ide

mercurial