diff --git a/gajim/__init__.py b/gajim/__init__.py index 065e0a0b2..7c84fe3d6 100644 --- a/gajim/__init__.py +++ b/gajim/__init__.py @@ -1,10 +1,15 @@ +import os import subprocess __version__ = "1.0.3" +IS_FLATPAK = False +if os.path.exists('/app/share/run-as-flatpak'): + IS_FLATPAK = True + try: p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True, - stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) node = p.communicate()[0] if node: __version__ += '+' + node.decode('utf-8').strip() diff --git a/gajim/common/app.py b/gajim/common/app.py index 42d013696..65626c623 100644 --- a/gajim/common/app.py +++ b/gajim/common/app.py @@ -156,7 +156,6 @@ _dependencies = { 'PYCURL': False, 'GSPELL': False, 'IDLE': False, - 'RUN_AS_FLATPAK': False, } @@ -170,7 +169,7 @@ def is_installed(dependency): return _dependencies[dependency] def is_flatpak(): - return _dependencies['RUN_AS_FLATPAK'] + return gajim.IS_FLATPAK def disable_dependency(dependency): _dependencies[dependency] = False @@ -296,10 +295,6 @@ def detect_dependencies(): except (ImportError, ValueError): pass - # RUN AS FLATPAK - if os.path.exists('/app/share/run-as-flatpak'): - _dependencies['RUN_AS_FLATPAK'] = True - # Print results for dep, val in _dependencies.items(): log('gajim').info('%-13s %s', dep, val)