mirror of
https://github.com/jdegenstein/jmwright-CQ-Editor.git
synced 2025-12-24 00:14:28 +01:00
from jmwright 72b67da
This commit is contained in:
28
cq_editor/__main__.py
Normal file
28
cq_editor/__main__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
NAME = 'CQ-editor'
|
||||
|
||||
#need to initialize QApp here, otherewise svg icons do not work on windows
|
||||
app = QApplication(sys.argv,
|
||||
applicationName=NAME)
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
||||
def main():
|
||||
|
||||
parser = argparse.ArgumentParser(description=NAME)
|
||||
parser.add_argument('filename',nargs='?',default=None)
|
||||
|
||||
args = parser.parse_args(app.arguments()[1:])
|
||||
|
||||
win = MainWindow(filename=args.filename if args.filename else None)
|
||||
win.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user