Skip to content

Commit

Permalink
chore: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 23, 2024
1 parent abbdeed commit 9b12f90
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
6 changes: 0 additions & 6 deletions umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@ def test_get_libc(self):
umu_util.get_libc(), str, "Value is not a string"
)

def test_is_steamdeck(self):
"""Test is_steamdeck."""
self.assertIsInstance(
umu_util.is_steamdeck(), bool, "Expected a boolean"
)

def test_is_installed_verb_noverb(self):
"""Test is_installed_verb when passed an empty verb."""
verb = []
Expand Down
27 changes: 0 additions & 27 deletions umu/umu_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,3 @@ def is_winetricks_verb(
return False

return True


@lru_cache
def is_steamdeck() -> bool:
"""Determine if the host device is a Steam Deck by its CPU model."""
cpu_info: Path = Path("/proc/cpuinfo")
is_sd: bool = False
sd_models: set[str] = {"AMD Custom APU 0405", "AMD Custom APU 0932"}

if not cpu_info.is_file():
return is_sd

with cpu_info.open(mode="r", encoding="utf-8") as file:
for line in file:
if line.startswith("model name"):
_: str = line[line.find(":") + 1 :].strip()
if _ in sd_models:
is_sd = True
break

return is_sd


@lru_cache
def whereis(bin: str) -> str:
"""Return the absolute path of an executable."""
return which(bin) or ""

0 comments on commit 9b12f90

Please sign in to comment.