diff options
Diffstat (limited to 'kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py')
-rw-r--r-- | kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py index cace0340c..eff0e6368 100644 --- a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py +++ b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py @@ -19,7 +19,7 @@ class Datasource: try: self.connection = keximainwindow.getConnection() except: - raise "No connection established. Please open a project before." + raise Exception("No connection established. Please open a project before.") self.schema = None @@ -65,9 +65,9 @@ class Datasource: if not self.cursor: self.cursor = self.connection.executeQuerySchema( self.queryschema ) if not self.cursor: - raise "Failed to execute queryschema." + raise Exception("Failed to execute queryschema.") if not self.cursor.moveFirst(): - raise "Failed to move cursor to first record." + raise Exception("Failed to move cursor to first record.") if self.cursor.eof(): self.cursor = None return None @@ -131,7 +131,7 @@ class HtmlExporter: if items == None: break output.write("<tr>") for item in items: - u = unicode(str(self.htmlescape(item)),"latin-1") + u = str(str(self.htmlescape(item)),"latin-1") output.write("<td>%s</td>" % u.encode("utf-8")) output.write("</tr>\n") output.write("</table>\n") @@ -144,7 +144,7 @@ class GuiApp: try: import gui except: - raise "Import of the Kross GUI module failed." + raise Exception("Import of the Kross GUI module failed.") self.dialog = gui.Dialog("Export XHTML") self.dialog.addLabel(self.dialog, "Export a table- or query-datasource to a XHTML-file.") @@ -176,10 +176,10 @@ class GuiApp: def doExport(self): file = str( self.file.get() ) query = str( self.datasourcelist.get() ) - print "Exporting '%s' to file '%s' ..." % (query,file) + print("Exporting '%s' to file '%s' ..." % (query,file)) if not self.datasource.setSource(query): - raise "Invalid datasource selected." + raise Exceptin("Invalid datasource selected.") #return style = str( self.stylelist.get() ) @@ -190,7 +190,7 @@ class GuiApp: exporter.write(f, style) f.close() - print "Successfully exported '%s' to file %s" % (query,file) + print("Successfully exported '%s' to file %s" % (query,file)) self.dialog.close() GuiApp( Datasource() ) |