scripts/compileUiFiles.py

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
54e42bc2437a
child 9221
bf71ee032bb4
--- a/scripts/compileUiFiles.py	Tue Jul 05 16:34:43 2022 +0200
+++ b/scripts/compileUiFiles.py	Thu Jul 07 11:23:56 2022 +0200
@@ -8,6 +8,7 @@
 Script for eric to compile all .ui files to Python source.
 """
 
+import os
 import sys
 
 from PyQt6.uic import compileUiDir
@@ -29,7 +30,14 @@
     """
     Compile the .ui files to Python sources.
     """
-    compileUiDir("eric7", True, __pyName)
+    if os.path.exists("src"):
+        # eric7 with 'src' layout
+        compileUiDir(os.path.join("src", "eric7"), True, __pyName)
+    elif os.path.exists("eric7"):
+        # old layout or invoked from within 'src'
+        compileUiDir("eric7", True, __pyName)
+    else:
+        print("No valid 'eric7' source layout could be found. Aborting...")
 
 
 def main(argv):

eric ide

mercurial