compileUiFiles.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1509
c0b5e693b0eb
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
9 """ 9 """
10 10
11 import sys 11 import sys
12 import os 12 import os
13 13
14
14 def compileUiFiles(): 15 def compileUiFiles():
15 """ 16 """
16 Compile the .ui files to Python sources. 17 Compile the .ui files to Python sources.
17 """ 18 """
18 try: 19 try:
19 from PyQt4.uic import compileUiDir 20 from PyQt4.uic import compileUiDir
20 except ImportError: 21 except ImportError:
21 from PyQt4.uic import compileUi 22 from PyQt4.uic import compileUi
22 23
23 def compileUiDir(dir, recurse = False, map = None, # __IGNORE_WARNING__ 24 def compileUiDir(dir, recurse = False, map = None, # __IGNORE_WARNING__
24 **compileUi_args): 25 ** compileUi_args):
25 """ 26 """
26 Creates Python modules from Qt Designer .ui files in a directory or 27 Creates Python modules from Qt Designer .ui files in a directory or
27 directory tree. 28 directory tree.
28 29
29 Note: This function is a modified version of the one found in PyQt4. 30 Note: This function is a modified version of the one found in PyQt4.
94 """ 95 """
95 return py_dir, "Ui_{0}".format(py_file) 96 return py_dir, "Ui_{0}".format(py_file)
96 97
97 compileUiDir(".", True, pyName) 98 compileUiDir(".", True, pyName)
98 99
100
99 def main(argv): 101 def main(argv):
100 """ 102 """
101 The main function of the script. 103 The main function of the script.
102 104
103 @param argv the list of command line arguments. 105 @param argv the list of command line arguments.

eric ide

mercurial