diff options
| author | tassaron | 2017-07-23 01:53:54 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-23 01:53:54 -0400 |
| commit | bf0890e7c87c730b8970c1a20c5b6a9a1a55d203 (patch) | |
| tree | bc66d222a5f04598db97df419f5affa35b723f6f /src/main.py | |
| parent | 450b944b87487aa60a935bbeee3908e2a62cd45b (diff) | |
components auto-connect & track widgets, less autosave spam
importing toolkit from live interpreter now works
Diffstat (limited to 'src/main.py')
| -rw-r--r-- | src/main.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/main.py b/src/main.py index 6a9a25e..977da3b 100644 --- a/src/main.py +++ b/src/main.py @@ -2,22 +2,17 @@ from PyQt5 import uic, QtWidgets import sys import os +from __init__ import wd -def main(): - if getattr(sys, 'frozen', False): - # frozen - wd = os.path.dirname(sys.executable) - else: - # unfrozen - wd = os.path.dirname(os.path.realpath(__file__)) - # make local imports work everywhere - sys.path.insert(0, wd) +def main(): + app = QtWidgets.QApplication(sys.argv) + app.setApplicationName("audio-visualizer") + # Determine mode mode = 'GUI' if len(sys.argv) > 2: mode = 'commandline' - elif len(sys.argv) == 2: if sys.argv[1].startswith('-'): mode = 'commandline' @@ -28,11 +23,7 @@ def main(): # normal gui launch proj = None - print('Starting Audio Visualizer in %s mode' % mode) - app = QtWidgets.QApplication(sys.argv) - app.setApplicationName("audio-visualizer") - # app.setOrganizationName("audio-visualizer") - + # Launch program if mode == 'commandline': from command import Command @@ -61,9 +52,7 @@ def main(): signal.signal(signal.SIGINT, main.cleanUp) atexit.register(main.cleanUp) - # applicable to both modes sys.exit(app.exec_()) - if __name__ == "__main__": main() |
