diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-06-27 11:58:31 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-06-27 11:58:31 +0200 |
commit | cc008de481bf1b67790d48b648d7c8207b9f50ea (patch) | |
tree | a2e94bb607ff57529faff489555dd2e53716119f /helpers | |
parent | 98ff43054fe94f333e2deda2906cd62593ded1d8 (diff) | |
download | MusicSampler-cc008de481bf1b67790d48b648d7c8207b9f50ea.tar.gz MusicSampler-cc008de481bf1b67790d48b648d7c8207b9f50ea.tar.zst MusicSampler-cc008de481bf1b67790d48b648d7c8207b9f50ea.zip |
Add version number
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
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(): | |||
9 | path = os.path.dirname(os.path.realpath(__file__)) | 9 | path = os.path.dirname(os.path.realpath(__file__)) |
10 | return path + "/../" | 10 | return path + "/../" |
11 | 11 | ||
12 | def parse_args(): | ||
13 | for arg in sys.argv: | ||
14 | if arg == "-v": | ||
15 | sys.argv.remove(arg) | ||
16 | |||
17 | if getattr(sys, 'frozen', False): | ||
18 | f = open(path() + ".pyinstaller_commit", "r") | ||
19 | print(f.read(), end="") | ||
20 | f.close() | ||
21 | else: | ||
22 | print("option '-v' can only be used in bundled package") | ||
23 | sys.exit() | ||
24 | |||
12 | def duration_to_min_sec(duration): | 25 | def duration_to_min_sec(duration): |
13 | minutes = int(duration / 60) | 26 | minutes = int(duration / 60) |
14 | seconds = int(duration) % 60 | 27 | seconds = int(duration) % 60 |