diff options
author | ormorph <roma251078@mail.ru> | 2024-04-20 21:46:29 +0300 |
---|---|---|
committer | ormorph <roma251078@mail.ru> | 2024-04-20 21:49:49 +0300 |
commit | 69bf5c34cbcf8e94d876f448ee4d8e292cf0d7e3 (patch) | |
tree | 6592d5e21472cdfcf74751f935f2629c21c2f5f5 /src | |
parent | 165eef292c68e194aa6e5aa8da13023074efcefd (diff) | |
download | pytdeextensions-69bf5c34cbcf8e94d876f448ee4d8e292cf0d7e3.tar.gz pytdeextensions-69bf5c34cbcf8e94d876f448ee4d8e292cf0d7e3.zip |
Fixing tdedesigner and tqtuicompiler modules not working
Python3 compatibility fix
Signed-off-by: ormorph <roma251078@mail.ru>
Diffstat (limited to 'src')
-rw-r--r-- | src/tdedesigner.py | 8 | ||||
-rw-r--r-- | src/tqtdesigner.py | 8 | ||||
-rw-r--r-- | src/tqtuicompiler.py | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/tdedesigner.py b/src/tdedesigner.py index c96fa86..93cb6bd 100644 --- a/src/tdedesigner.py +++ b/src/tdedesigner.py @@ -15,11 +15,11 @@ # # ########################################################################### -import __builtin__ +import builtins as __builtin__ import tqtuicompiler python_import = __builtin__.__import__ -def load(*args): - tqtuicompiler.DynamicImport(args,True) - return apply(python_import,args) +def load(name, glob = None, loc = None, fromlist = tuple(), level = 0): + tqtuicompiler.DynamicImport((name,),True) + return python_import(name, glob, loc, fromlist, level) __builtin__.__import__ = load diff --git a/src/tqtdesigner.py b/src/tqtdesigner.py index c31edee..8bf3a33 100644 --- a/src/tqtdesigner.py +++ b/src/tqtdesigner.py @@ -15,12 +15,12 @@ # # ########################################################################### -import __builtin__ +import builtins as __builtin__ import tqtuicompiler python_import = __builtin__.__import__ -def load(*args): - tqtuicompiler.DynamicImport(args,False) - return apply(python_import,args) +def load(name, glob = None, loc = None, fromlist = tuple(), level = 0): + tqtuicompiler.DynamicImport((name,),False) + return python_import(name, glob, loc, fromlist, level) __builtin__.__import__ = load diff --git a/src/tqtuicompiler.py b/src/tqtuicompiler.py index 0e84838..bf7ff11 100644 --- a/src/tqtuicompiler.py +++ b/src/tqtuicompiler.py @@ -59,11 +59,11 @@ def CompileUI(ui_file_name, py_file_name=None, kde=False): input = open(tmp_file_name, 'r') output = open(py_file_name, 'w') for line in input.readlines(): - if kde and string.strip(line) == 'from PyTQt.tqt import *': + if kde and str.strip(line) == 'from PyTQt.tqt import *': output.write(line) output.write('from tdecore import *\nfrom tdeui import *\n\n') - elif kde and string.find(line, " = KDatePicker(") != -1: - o = string.find(line, ",") + elif kde and str.find(line, " = KDatePicker(") != -1: + o = str.find(line, ",") output.write(line[:o] + ",TQDate.currentDate()" + line[o:]) else: output.write (line) |