Determine earlier if we run as Flatpak

This commit is contained in:
Philipp Hörist 2018-05-27 13:45:07 +02:00
parent b749eccf51
commit dbbf078229
2 changed files with 7 additions and 7 deletions

View File

@ -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()

View File

@ -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)