From 86480e58eafc1fa3486e03155ed34e02b4595a24 Mon Sep 17 00:00:00 2001 From: Slávek Banko Date: Sun, 22 Jan 2023 02:02:13 +0100 Subject: Drop python2 support in scripts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- .../scripts/projectdocumentor/ProjectDocumentor.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py') diff --git a/kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py b/kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py index 89a60301b..cb4e0de7b 100755 --- a/kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py +++ b/kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py @@ -20,7 +20,7 @@ class DataProvider: try: self.connection = keximainwindow.getConnection() except: - raise "No connection established. Please open the project to be documented first." + raise Exception("No connection established. Please open the project to be documented first.") def printConnection(self): condata = self.connection.data() @@ -96,7 +96,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("Project Documentor") @@ -130,7 +130,7 @@ class GuiApp: def toHTML(self, value): import types result = "" - if isinstance(value, types.TupleType): + if isinstance(value, tuple): result += "" - elif isinstance(value, types.ListType): + elif isinstance(value, list): for item in value: result += "%s" % self.toHTML(item) else: @@ -151,7 +151,7 @@ class GuiApp: def doSave(self): file = str( self.file.get() ) - print "Attempting to save project documentation to file: %s" % file + print("Attempting to save project documentation to file: %s" % file) f = open(file, "w") @@ -167,19 +167,19 @@ class GuiApp: for d in dir(self.dataprovider): if d.startswith("print"): - print "GuiApp.doSave() CHECK %s" % d + print("GuiApp.doSave() CHECK %s" % d) a = self.printCheckBoxes[d] if a and a.isChecked(): - print "GuiApp.doSave() BEGIN %s" % d + print("GuiApp.doSave() BEGIN %s" % d) value = getattr(self.dataprovider,d)() if value != None and len(value) > 0: f.write("

%s

" % d[5:]) f.write( self.toHTML(value) ) - print "GuiApp.doSave() END %s" % d + print("GuiApp.doSave() END %s" % d) f.close() - print "Successfully saved project documentation to file: %s" % file + print("Successfully saved project documentation to file: %s" % file) self.dialog.close() GuiApp( DataProvider() ) -- cgit v1.2.3