__init__.py 421 Bytes
Newer Older
1
import os
André's avatar
André committed
2 3
import subprocess

Yann Leboulanger's avatar
Yann Leboulanger committed
4
__version__ = "1.1.2"
André's avatar
André committed
5

6 7 8 9
IS_FLATPAK = False
if os.path.exists('/app/share/run-as-flatpak'):
    IS_FLATPAK = True

André's avatar
André committed
10
try:
André's avatar
André committed
11
    p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
12
                         stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
André's avatar
André committed
13
    node = p.communicate()[0]
André's avatar
André committed
14
    if node:
André's avatar
André committed
15
        __version__ += '+' + node.decode('utf-8').strip()
André's avatar
André committed
16 17
except Exception:
    pass