Determine earlier if we run as Flatpak
This commit is contained in:
parent
b749eccf51
commit
dbbf078229
2 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,12 @@
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
__version__ = "1.0.3"
|
__version__ = "1.0.3"
|
||||||
|
|
||||||
|
IS_FLATPAK = False
|
||||||
|
if os.path.exists('/app/share/run-as-flatpak'):
|
||||||
|
IS_FLATPAK = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
|
p = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||||
|
|
|
@ -156,7 +156,6 @@ _dependencies = {
|
||||||
'PYCURL': False,
|
'PYCURL': False,
|
||||||
'GSPELL': False,
|
'GSPELL': False,
|
||||||
'IDLE': False,
|
'IDLE': False,
|
||||||
'RUN_AS_FLATPAK': False,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,7 +169,7 @@ def is_installed(dependency):
|
||||||
return _dependencies[dependency]
|
return _dependencies[dependency]
|
||||||
|
|
||||||
def is_flatpak():
|
def is_flatpak():
|
||||||
return _dependencies['RUN_AS_FLATPAK']
|
return gajim.IS_FLATPAK
|
||||||
|
|
||||||
def disable_dependency(dependency):
|
def disable_dependency(dependency):
|
||||||
_dependencies[dependency] = False
|
_dependencies[dependency] = False
|
||||||
|
@ -296,10 +295,6 @@ def detect_dependencies():
|
||||||
except (ImportError, ValueError):
|
except (ImportError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# RUN AS FLATPAK
|
|
||||||
if os.path.exists('/app/share/run-as-flatpak'):
|
|
||||||
_dependencies['RUN_AS_FLATPAK'] = True
|
|
||||||
|
|
||||||
# Print results
|
# Print results
|
||||||
for dep, val in _dependencies.items():
|
for dep, val in _dependencies.items():
|
||||||
log('gajim').info('%-13s %s', dep, val)
|
log('gajim').info('%-13s %s', dep, val)
|
||||||
|
|
Loading…
Add table
Reference in a new issue