diff options
| author | Denis Jacquerye | 2015-10-23 09:56:32 +0100 | 
|---|---|---|
| committer | Denis Jacquerye | 2015-10-23 09:56:32 +0100 | 
| commit | cc479ee8aa0c42f637e10a5fb71a210c43f7a989 (patch) | |
| tree | 2c39012abf0def64f4c197371f9298a9ba28c888 | |
| parent | 2bffd65e38fffa99df9f4d140a02642caf2e952d (diff) | |
| download | trufont-cc479ee8aa0c42f637e10a5fb71a210c43f7a989.tar.bz2 | |
defconQt/__main__.py: move code to main() and call when __name__ is “__main__”
| -rw-r--r-- | Lib/defconQt/__main__.py | 37 | 
1 files changed, 19 insertions, 18 deletions
| diff --git a/Lib/defconQt/__main__.py b/Lib/defconQt/__main__.py index 18d7422..663a4b7 100644 --- a/Lib/defconQt/__main__.py +++ b/Lib/defconQt/__main__.py @@ -8,23 +8,24 @@ from PyQt5.QtGui import QIcon  def main(): -    if __name__ == "__main__": -        main() -if len(sys.argv) > 1: -    font = TFont(os.path.abspath(sys.argv[1])) -else: -    font = None +    if len(sys.argv) > 1: +        font = TFont(os.path.abspath(sys.argv[1])) +    else: +        font = None -# from pycallgraph import PyCallGraph -# from pycallgraph.output import GraphvizOutput -representationFactories.registerAllFactories() -# with PyCallGraph(output=GraphvizOutput()): -app = Application(sys.argv) -# TODO: http://stackoverflow.com/a/21330349/2037879 -app.setOrganizationName("A. Tétar & Co.") -app.setApplicationName("TruFont") -app.setWindowIcon(QIcon(":/resources/app.png")) -window = MainWindow(font) -window.show() -sys.exit(app.exec_()) +    # from pycallgraph import PyCallGraph +    # from pycallgraph.output import GraphvizOutput +    representationFactories.registerAllFactories() +    # with PyCallGraph(output=GraphvizOutput()): +    app = Application(sys.argv) +    # TODO: http://stackoverflow.com/a/21330349/2037879 +    app.setOrganizationName("A. Tétar & Co.") +    app.setApplicationName("TruFont") +    app.setWindowIcon(QIcon(":/resources/app.png")) +    window = MainWindow(font) +    window.show() +    sys.exit(app.exec_()) + +if __name__ == "__main__": +    main() | 
