__init__.py 421 Bytes
Newer Older
1
import os
2 3
import subprocess

Martin's avatar
Martin committed
4
__version__ = "1.1.2"
5 6 7 8

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

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