From cc008de481bf1b67790d48b648d7c8207b9f50ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 27 Jun 2016 11:58:31 +0200 Subject: Add version number --- helpers/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'helpers') diff --git a/helpers/__init__.py b/helpers/__init__.py index 0f819e7..f3e5967 100644 --- a/helpers/__init__.py +++ b/helpers/__init__.py @@ -9,6 +9,19 @@ def path(): path = os.path.dirname(os.path.realpath(__file__)) return path + "/../" +def parse_args(): + for arg in sys.argv: + if arg == "-v": + sys.argv.remove(arg) + + if getattr(sys, 'frozen', False): + f = open(path() + ".pyinstaller_commit", "r") + print(f.read(), end="") + f.close() + else: + print("option '-v' can only be used in bundled package") + sys.exit() + def duration_to_min_sec(duration): minutes = int(duration / 60) seconds = int(duration) % 60 -- cgit v1.2.3