diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-27 15:36:56 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-27 16:19:26 -0400 |
commit | 62a0f06397e8229df648427d5e43da7267a20f4e (patch) | |
tree | 2c6b19024ffc85626b5ac11ed95e895cb2642970 /src/leap/bitmask/gui/app.py | |
parent | 6cf1751a4231d6454e69641655b6c5ea848bff6d (diff) |
[feature] allow the frozen binary to function as cli too
Diffstat (limited to 'src/leap/bitmask/gui/app.py')
-rw-r--r-- | src/leap/bitmask/gui/app.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index c87ba88e..4bd91909 100644 --- a/src/leap/bitmask/gui/app.py +++ b/src/leap/bitmask/gui/app.py @@ -68,8 +68,7 @@ class BrowserWindow(QtWidgets.QDialog): sys.exit(1) -def start_app(): - +def launch_gui(): global qApp global bitmaskd @@ -86,5 +85,18 @@ def start_app(): sys.exit(qApp.exec_()) +def start_app(): + from leap.bitmask.util import STANDALONE + + # Allow the frozen binary in the bundle double as the cli entrypoint + # Why have only a user interface when you can have two? + + if STANDALONE and len(sys.argv) > 1: + from leap.bitmask.cli import bitmask_cli + return bitmask_cli.main() + + launch_gui() + + if __name__ == "__main__": start_app() |