]>
git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - helpers/__init__.py
2131c2a41a31bc8c628e60068e9f45ea298d44f4
1 # -*- coding: utf-8 -*-
6 def __init__(self
, **kwargs
):
8 setattr(self
, arg
, kwargs
[arg
])
10 config
= Config(yml_file
="config.yml")
13 if getattr(sys
, 'frozen', False):
14 return sys
._MEIPASS
+ "/"
16 path
= os
.path
.dirname(os
.path
.realpath(__file__
))
23 config
.yml_file
= arg
[2:]
28 if getattr(sys
, 'frozen', False):
29 f
= open(path() + ".pyinstaller_commit", "r")
30 print(f
.read(), end
="")
33 print("option '-v' can only be used in bundled package")
37 return config
.yml_file
39 def duration_to_min_sec(duration
):
40 minutes
= int(duration
/ 60)
41 seconds
= int(duration
) % 60
43 return "{:2}:{:0>2}".format(minutes
, seconds
)
45 return "{}:{:0>2}".format(minutes
, seconds
)