Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #3102

Merged
merged 18 commits into from
Sep 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More improvements
  • Loading branch information
TheEvilSkeleton committed Jan 31, 2023
commit 145faa37669fbb9200e9012d491855b047b7fb98
76 changes: 23 additions & 53 deletions bottles/backend/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,16 @@ def __init__(self):
}
self.get_ram_data()

if "FLATPAK_ID" not in os.environ:
self.cabextract = self.check_cabextract()
self.p7zip = self.check_p7zip()
self.patool = self.check_patool()
self.icoextract = self.check_icoextract()
self.pefile = self.check_pefile()
self.orjson = self.check_orjson()
self.markdown = self.check_markdown()
self.xdpyinfo = self.check_xdpyinfo()
self.ImageMagick = self.check_ImageMagick()
self.FVS = self.check_FVS()
else:
self.cabextract = True
self.p7zip = True
self.patool = True
self.icoextract = True
self.pefile = True
self.orjson = True
self.markdown = True
self.ImageMagick = True
self.FVS = True
self.cabextract = self.check_cabextract()
self.p7zip = self.check_p7zip()
self.patool = self.check_patool()
self.icoextract = self.check_icoextract()
self.pefile = self.check_pefile()
self.orjson = self.check_orjson()
self.markdown = self.check_markdown()
self.xdpyinfo = self.check_xdpyinfo()
self.ImageMagick = self.check_ImageMagick()
self.FVS = self.check_FVS()

@staticmethod
def check_gpus():
Expand All @@ -104,38 +93,33 @@ def check_x11(self):

@staticmethod
def check_wayland():
if "WAYLAND_DISPLAY" in os.environ:
return True
return False
return "WAYLAND_DISPLAY" in os.environ

def check_xwayland(self):
if self.x11 and self.wayland:
return True
return False
return self.x11 and self.wayland

def check_desktop(self):
return os.environ.get("DESKTOP_SESSION")

@staticmethod
def check_cabextract():
res = shutil.which("cabextract")
if res is None:
return False
return True
return bool(shutil.which("cabextract"))

@staticmethod
def check_p7zip():
res = shutil.which("7z")
if res is None:
return False
return True
return bool(shutil.which("7z"))

@staticmethod
def check_patool():
res = shutil.which("patool")
if res is None:
return False
return True
return bool(shutil.which("patool"))

@staticmethod
def check_xdpyinfo():
return bool(shutil.which("xdpyinfo"))

@staticmethod
def check_ImageMagick():
return bool(shutil.which("identify"))

@staticmethod
def check_icoextract():
Expand Down Expand Up @@ -169,20 +153,6 @@ def check_orjson():
except ModuleNotFoundError:
return False

@staticmethod
def check_xdpyinfo():
res = shutil.which("xdpyinfo")
if res is None:
return False
return True

@staticmethod
def check_ImageMagick():
res = shutil.which("identify")
if res is None:
return False
return True

@staticmethod
def check_FVS():
try:
Expand Down