915 |
915 |
916 |
916 |
917 def compileUiFiles(): |
917 def compileUiFiles(): |
918 """ |
918 """ |
919 Compile the .ui files to Python sources. |
919 Compile the .ui files to Python sources. |
920 """ |
920 """ # __IGNORE_WARNING__ |
921 global sourceDir |
921 global sourceDir |
922 try: |
922 try: |
923 from PyQt4.uic import compileUiDir |
923 from PyQt4.uic import compileUiDir |
924 except ImportError: |
924 except ImportError: |
925 from PyQt4.uic import compileUi |
925 from PyQt4.uic import compileUi |
926 |
926 |
927 def compileUiDir(dir, recurse = False, map = None, # __IGNORE_WARNING__ |
927 def compileUiDir(dir, recurse=False, # __IGNORE_WARNING__ |
928 ** compileUi_args): |
928 map=None, **compileUi_args): |
929 """ |
929 """ |
930 Creates Python modules from Qt Designer .ui files in a directory or |
930 Creates Python modules from Qt Designer .ui files in a directory or |
931 directory tree. |
931 directory tree. |
932 |
932 |
933 Note: This function is a modified version of the one found in PyQt4. |
933 Note: This function is a modified version of the one found in PyQt4. |
1057 doCompile = False |
1057 doCompile = False |
1058 elif opt == "-f": |
1058 elif opt == "-f": |
1059 try: |
1059 try: |
1060 exec(compile(open(arg).read(), arg, 'exec'), globals()) |
1060 exec(compile(open(arg).read(), arg, 'exec'), globals()) |
1061 if len(cfg) != configLength: |
1061 if len(cfg) != configLength: |
1062 print("The configuration dictionary in '{0}' is incorrect. Aborting"\ |
1062 print("The configuration dictionary in '{0}' is incorrect." |
1063 .format(arg)) |
1063 " Aborting".format(arg)) |
1064 exit(6) |
1064 exit(6) |
1065 except: |
1065 except: |
1066 cfg = {} |
1066 cfg = {} |
1067 elif opt == "-m": |
1067 elif opt == "-m": |
1068 macAppBundleName = arg |
1068 macAppBundleName = arg |