File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1919# along with this program. If not, see <https://www.gnu.org/licenses/>.
2020#
2121
22- from core import main
23- from ui import ui_main
2422from sys import argv
2523
2624VERSION = "v0.1-alpha"
2725
2826def start_csg ():
2927 if "--cli" in argv :
28+ from core import main
3029 main ()
3130
3231 elif "--help" in argv or "-h" in argv :
@@ -36,10 +35,21 @@ def start_csg():
3635 version ()
3736
3837 else :
39- if len (argv ) > 1 :
40- print ("[!] Ignoring extra argument(s): " , ", " .join (argv [1 :]))
38+ try :
39+ from ui import ui_main
40+
41+ if len (argv ) > 1 :
42+ print ("[!] Ignoring extra argument(s): " , ", " .join (argv [1 :]))
43+
44+ ui_main ()
45+
46+ except ModuleNotFoundError :
47+ print ("[!] PyQt5 needs to be installed to run the graphical front-end." )
48+ print (f"""[!] Try running '{ argv [0 ]} --cli' to run CSG from the command-line
49+ or install PyQt5 by running 'pip install pyqt5'""" )
50+
51+ exit ()
4152
42- ui_main ()
4353
4454def usage ():
4555 print (f"Usage: { argv [0 ]} [OPTION]" )
You can’t perform that action at this time.
0 commit comments