scripts/compileUiFiles.py

branch
without_py2_and_pyqt4
changeset 7198
684261ef2165
parent 6942
2602857055c5
child 7229
53054eb5b15a
equal deleted inserted replaced
7197:331569d44b19 7198:684261ef2165
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

eric ide

mercurial