diff options
author | Slávek Banko <[email protected]> | 2023-01-22 02:02:13 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2023-01-22 02:02:13 +0100 |
commit | 86480e58eafc1fa3486e03155ed34e02b4595a24 (patch) | |
tree | 0e8f64c4003ea558e946b7a3347688904b451635 /kspread/plugins/scripting/scripts/exporthtml | |
parent | 135d005014a1e85295af4e379f026a361537ae5f (diff) | |
download | koffice-86480e58eafc1fa3486e03155ed34e02b4595a24.tar.gz koffice-86480e58eafc1fa3486e03155ed34e02b4595a24.zip |
Drop python2 support in scripts.
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'kspread/plugins/scripting/scripts/exporthtml')
-rwxr-xr-x | kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py index d38771fc..7d308ab2 100755 --- a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py +++ b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py @@ -18,7 +18,7 @@ import os, sys try: from TQt import qt except (ImportError): - raise "Failed to import the required PyTQt python module." + raise Exception("Failed to import the required PyTQt python module.") class Dialog(tqt.QDialog): def __init__(self, scriptpath, parent): @@ -69,7 +69,7 @@ class Dialog(tqt.QDialog): stylebox.setSpacing(6) stylelabel = qt.TQLabel("Style:",stylebox) self.stylecombo = qt.TQComboBox(stylebox) - stylenames = self.styles.keys() + stylenames = list(self.styles.keys()) stylenames.sort() for stylename in stylenames: self.stylecombo.insertItem(stylename) @@ -123,12 +123,13 @@ class Dialog(tqt.QDialog): sheetname = str( self.sheetcombo.currentText() ) sheet = self.doc.sheetByName( sheetname ) - print "sheetname=%s sheet=%s" % (sheetname,sheet) + print("sheetname=%s sheet=%s" % (sheetname,sheet)) filename = str( self.fileedit.text() ) try: file = open(filename, "w") - except IOError, (errno, strerror): + except IOError as xxx_todo_changeme: + (errno, strerror) = xxx_todo_changeme.args qt.TQMessageBox.critical(self,"Error","<qt>Failed to create HTML file \"%s\"<br><br>%s</qt>" % (filename,strerror)) return |