diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-27 18:28:13 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-27 18:28:13 +0300 |
commit | 3baa6b3376ace3979c345d8ceba490f3303e6aa4 (patch) | |
tree | 4f2bb3c9b0fde47de68772397db66ef60027a677 /launch.py | |
parent | 17b9e7acc63fc5bb8d43131a9ebc4b57171f873f (diff) |
refactor: Simplify launch.py
Diffstat (limited to 'launch.py')
-rwxr-xr-x | launch.py | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -2,16 +2,14 @@ import subprocess -from gajim import gajim +import gajim +from gajim.gajim import main try: - p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True, - stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) - node = p.communicate()[0] - if node: - import gajim as g - g.__version__ += '+' + node.decode('utf-8').strip() + res = subprocess.check_output( + ['git', 'rev-parse', '--short=12', 'HEAD']) # noqa: S603, S607 + gajim.__version__ += f'+{res.decode().strip()}' except Exception: pass -gajim.main() +main() |