sborho / qct (http://qct.sourceforge.net/)

Qct Commit Tool

Clone this repository (size: 558.5 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/sborho/qct/
commit 562: 9b39e1bad965
parent 561: 1fd3706fa24f
branch: default
directly import PyQt4.uic in setup.py Get rid of pyuic4 kludge, which never worked on Windows
Steve Borho / sborho
13 months ago

Changed (Δ476 bytes):

raw changeset »

setup.py (7 lines added, 16 lines removed)

Up to file-list setup.py:

@@ -54,22 +54,13 @@ class QctBuild(build):
54
54
    def compile_ui(self, ui_file, py_file):
55
55
        # Search for pyuic4 in python bin dir, then in the $Path.
56
56
        try:
57
            from PyQt4 import pyqtconfig
58
        except ImportError:
59
            pyuic_exe = None
60
        else:
61
            pyqt_configuration = pyqtconfig.Configuration()
62
            pyuic_exe = find_executable('pyuic4', pyqt_configuration.default_bin_dir)
63
        if not pyuic_exe: pyuic_exe = find_executable('pyuic4')
64
        if not pyuic_exe: pyuic_exe = find_executable('pyuic4.bat')
65
        if not pyuic_exe: print "Unable to find pyuic4 executable"; return
66
        cmd = [pyuic_exe, ui_file, '-o', py_file]
67
        try:
68
            spawn(cmd)
69
        except:
70
            print pyuic_exe + " is a shell script"
71
            cmd = ['/bin/sh', '-e', pyuic_exe, ui_file, '-o', py_file]
72
            spawn(cmd)
57
            from PyQt4 import uic
58
            fp = open(py_file, 'w')
59
            uic.compileUi(ui_file, fp)
60
            fp.close()
61
        except Exception, e:
62
            print 'Unable to compile user interface', e
63
            return
73
64
74
65
    def run(self):
75
66
        if not os.path.exists('qctlib/ui_dialog.py'):