diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-01-17 02:24:54 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-01-17 02:24:54 +0100 |
commit | 12236609d02d708a0076a78145d527e023f47bab (patch) | |
tree | ea585d1c2f8f031920281887064c395698c0f409 /contrib/tdepyuic | |
parent | 62f0c8899cb28b78f41c56d467c1a18130177764 (diff) | |
download | pytde-12236609d02d708a0076a78145d527e023f47bab.tar.gz pytde-12236609d02d708a0076a78145d527e023f47bab.zip |
Convert tdepyuic to support Python 3.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'contrib/tdepyuic')
-rwxr-xr-x | contrib/tdepyuic | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/tdepyuic b/contrib/tdepyuic index 147711b..48444a8 100755 --- a/contrib/tdepyuic +++ b/contrib/tdepyuic @@ -57,7 +57,7 @@ def getOptions (): args = [] if opterr or (len (args) != 1): - print """\nUsage: + print("""\nUsage: tdepyuic [options] filename.ui @@ -66,7 +66,7 @@ def getOptions (): -i, --noimport Don't add tdecore, tdeui import statements -p, --pyuic Path to pyuic program --usetdei18n Adds TDEs default i18n functions to your Python TDE ui file - """ + """) return FALSE filename = args[0] @@ -124,7 +124,7 @@ def doPyuic (): if os.system (pyuicPath + opts + fn + ' ' + filename) != 0: - print pyuicPath + opts + fn + ' ' + filename + " failed" + print(pyuicPath + opts + fn + ' ' + filename + " failed") sys.exit (-1) if addApp or addImport: @@ -134,16 +134,16 @@ def doPyuic (): buff = m.readlines () for line in buff: - if addImport and (string.strip (line) == 'from PyTQt.qt import *'): + if addImport and (line.strip() == 'from PyTQt.qt import *'): n.write (line) addimport (n) - elif addApp and (string.strip (line) == 'a = TQApplication(sys.argv)'): + elif addApp and (line.strip() == 'a = TQApplication(sys.argv)'): indent = 0 while line [indent] in string.whitespace: indent = indent + 1 addapp (line[:indent], n) - elif string.find(line, " = KDatePicker(") != -1: - o = string.find(line, ",") + elif line.find(" = KDatePicker(") != -1: + o = line.find(",") n.write (line[:o] + ",TQDate.currentDate()" + line[o:]) else: n.write (line) @@ -154,7 +154,7 @@ def doPyuic (): os.unlink (fn) os.rename (fn + '.tmp', fn) - print fn + ' written' + print(fn + ' written') # --------- main ---------- |