10 |
10 |
11 from __future__ import unicode_literals, print_function |
11 from __future__ import unicode_literals, print_function |
12 |
12 |
13 import sys |
13 import sys |
14 |
14 |
15 # step 1: determine PyQt variant, preferring PyQt5 |
15 from PyQt5.uic import compileUiDir |
16 try: |
|
17 import PyQt5 # __IGNORE_WARNING__ |
|
18 pyqtVariant = "PyQt5" |
|
19 except ImportError: |
|
20 import PyQt4 # __IGNORE_WARNING__ |
|
21 pyqtVariant = "PyQt4" |
|
22 |
|
23 # step 2: compile the UI files |
|
24 if pyqtVariant == "PyQt4": |
|
25 from PyQt4.uic import compileUiDir |
|
26 else: |
|
27 from PyQt5.uic import compileUiDir |
|
28 |
16 |
29 |
17 |
30 def __pyName(py_dir, py_file): |
18 def __pyName(py_dir, py_file): |
31 """ |
19 """ |
32 Local function to create the Python source file name for the compiled |
20 Local function to create the Python source file name for the compiled |