E5XML/XMLStreamReaderBase.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3022
57179e4cdadd
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
48 def showErrorMessage(self): 48 def showErrorMessage(self):
49 """ 49 """
50 Public method to show an error message. 50 Public method to show an error message.
51 """ 51 """
52 if self.hasError(): 52 if self.hasError():
53 msg = QCoreApplication.translate("XMLStreamReaderBase", 53 msg = QCoreApplication.translate(
54 "XMLStreamReaderBase",
54 "<p>XML parse error in file <b>{0}</b>, line {1}," 55 "<p>XML parse error in file <b>{0}</b>, line {1},"
55 " column {2}</p><p>Error: {3}</p>").format( 56 " column {2}</p><p>Error: {3}</p>").format(
56 self.device().fileName(), 57 self.device().fileName(),
57 self.lineNumber(), self.columnNumber(), 58 self.lineNumber(), self.columnNumber(),
58 self.errorString()) 59 self.errorString())
59 E5MessageBox.warning(None, 60 E5MessageBox.warning(
61 None,
60 QCoreApplication.translate( 62 QCoreApplication.translate(
61 "XMLStreamReaderBase", "XML parse error"), 63 "XMLStreamReaderBase", "XML parse error"),
62 msg) 64 msg)
63 65
64 def raiseUnexpectedStartTag(self, tag): 66 def raiseUnexpectedStartTag(self, tag):
65 """ 67 """
66 Public method to raise an error for an unexpected start tag. 68 Public method to raise an error for an unexpected start tag.
67 69
68 @param tag name of the unexpected tag (string) 70 @param tag name of the unexpected tag (string)
69 """ 71 """
70 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", 72 self.raiseError(QCoreApplication.translate(
71 "Unexpected start tag '{0}'.".format(tag))) 73 "XMLStreamReaderBase", "Unexpected start tag '{0}'.".format(tag)))
72 74
73 def raiseUnsupportedFormatVersion(self, version): 75 def raiseUnsupportedFormatVersion(self, version):
74 """ 76 """
75 Public method to raise an error for an unsupported file format version. 77 Public method to raise an error for an unsupported file format version.
76 78
77 @param version unsupported version (string) 79 @param version unsupported version (string)
78 """ 80 """
79 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", 81 self.raiseError(QCoreApplication.translate(
82 "XMLStreamReaderBase",
80 "File format version '{0}' is not supported.").format(version)) 83 "File format version '{0}' is not supported.").format(version))
81 84
82 def raiseBadValue(self, value): 85 def raiseBadValue(self, value):
83 """ 86 """
84 Public method to raise an error for a bad value. 87 Public method to raise an error for a bad value.
85 88
86 @param value bad value (string) 89 @param value bad value (string)
87 """ 90 """
88 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", 91 self.raiseError(QCoreApplication.translate(
89 "Bad value: {0}").format(value)) 92 "XMLStreamReaderBase", "Bad value: {0}").format(value))
90 93
91 def readXML(self): 94 def readXML(self):
92 """ 95 """
93 Public method to read and parse the XML document. 96 Public method to read and parse the XML document.
94 """ 97 """

eric ide

mercurial