summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2023-01-22 02:02:13 +0100
committerSlávek Banko <slavek.banko@axis.cz>2023-01-22 02:02:13 +0100
commit86480e58eafc1fa3486e03155ed34e02b4595a24 (patch)
tree0e8f64c4003ea558e946b7a3347688904b451635 /kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py
parent135d005014a1e85295af4e379f026a361537ae5f (diff)
downloadkoffice-86480e58eafc1fa3486e03155ed34e02b4595a24.tar.gz
koffice-86480e58eafc1fa3486e03155ed34e02b4595a24.zip
Drop python2 support in scripts.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py')
-rwxr-xr-xkexi/plugins/scripting/scripts/projectdocumentor/ProjectDocumentor.py18
1 files changed, 9 insertions, 9 deletions
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 += "<ul>"
if len(value) == 1:
result += "<li>%s</li>" % value
@@ -142,7 +142,7 @@ class GuiApp:
if i != "":
result += "<li>%s</li>" % i
result += "</ul>"
- 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("<h2>%s</h2>" % 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() )