E5XML/TemplatesReader.py

changeset 589
a9a4620f6767
parent 587
3078a9781573
child 590
beb60b9b3d8d
equal deleted inserted replaced
588:573767cf6bde 589:a9a4620f6767
42 if self.isStartElement(): 42 if self.isStartElement():
43 if self.name() == "Templates": 43 if self.name() == "Templates":
44 self.version = self.attribute("version", templatesFileFormatVersion) 44 self.version = self.attribute("version", templatesFileFormatVersion)
45 elif self.name() == "TemplateGroup": 45 elif self.name() == "TemplateGroup":
46 self.__readTemplateGroup() 46 self.__readTemplateGroup()
47 else:
48 self.raiseUnexpectedStartTag(self.name())
47 49
48 self.showErrorMessage() 50 self.showErrorMessage()
49 51
50 def __readTemplateGroup(self): 52 def __readTemplateGroup(self):
51 """ 53 """
61 break 63 break
62 64
63 if self.isStartElement(): 65 if self.isStartElement():
64 if self.name() == "Template": 66 if self.name() == "Template":
65 self.__readTemplate() 67 self.__readTemplate()
68 else:
69 self.raiseUnexpectedStartTag(self.name())
66 70
67 def __readTemplate(self): 71 def __readTemplate(self):
68 """ 72 """
69 Private method to read the template definition. 73 Private method to read the template definition.
70 """ 74 """
83 if self.isStartElement(): 87 if self.isStartElement():
84 if self.name() == "TemplateDescription": 88 if self.name() == "TemplateDescription":
85 templateDescription = self.readElementText() 89 templateDescription = self.readElementText()
86 elif self.name() == "TemplateText": 90 elif self.name() == "TemplateText":
87 templateText = self.readElementText() 91 templateText = self.readElementText()
92 else:
93 self.raiseUnexpectedStartTag(self.name())

eric ide

mercurial