57 """ |
57 """ |
58 Public method to show an error message. |
58 Public method to show an error message. |
59 """ |
59 """ |
60 if self.hasError(): |
60 if self.hasError(): |
61 msg = QCoreApplication.translate("XMLStreamReaderBase", |
61 msg = QCoreApplication.translate("XMLStreamReaderBase", |
62 "<p>XML parse error in file <b>{0}</b>, line {1}, column {2}<p>" |
62 "<p>XML parse error in file <b>{0}</b>, line {1}, column {2}</p>" |
63 "<p>Error: {3}").format(self.device().fileName(), |
63 "<p>Error: {3}</p>").format(self.device().fileName(), |
64 self.lineNumber(), self.columnNumber(), self.errorString()) |
64 self.lineNumber(), self.columnNumber(), self.errorString()) |
65 E5MessageBox.warning(None, |
65 E5MessageBox.warning(None, |
66 QCoreApplication.translate("XMLStreamReaderBase", "XML parse error"), |
66 QCoreApplication.translate("XMLStreamReaderBase", "XML parse error"), |
67 msg) |
67 msg) |
68 |
68 |
80 Public method to raise an error for an unsupported file format version. |
80 Public method to raise an error for an unsupported file format version. |
81 |
81 |
82 @param version unsupported version (string) |
82 @param version unsupported version (string) |
83 """ |
83 """ |
84 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", |
84 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", |
85 "File format version '{0}' is not supported.".format(version))) |
85 "File format version '{0}' is not supported.").format(version)) |
86 |
86 |
87 def raiseBadValue(self, value): |
87 def raiseBadValue(self, value): |
88 """ |
88 """ |
89 Public method to raise an error for a bad value. |
89 Public method to raise an error for a bad value. |
90 |
90 |
91 @param value bad value (string) |
91 @param value bad value (string) |
92 """ |
92 """ |
93 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", |
93 self.raiseError(QCoreApplication.translate("XMLStreamReaderBase", |
94 "Bad value: {0}".format(value))) |
94 "Bad value: {0}").format(value)) |
95 |
95 |
96 def readXML(self): |
96 def readXML(self): |
97 """ |
97 """ |
98 Public method to read and parse the XML document. |
98 Public method to read and parse the XML document. |
99 """ |
99 """ |