mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
chore: abstract function to facilitate unit testing
This commit is contained in:
1 parent
fb2772cde2
commit
b8fbbbb1cd
1 file changed
+4
-2
+4
-2
@@ -344,13 +344,15 @@ def get_app_allows_downloads(path: Path, appid: int) -> bool:
|
|||||||
# NOTE: never allow
|
# NOTE: never allow
|
||||||
case 2:
|
case 2:
|
||||||
return False
|
return False
|
||||||
# NOTE: no other known values at this time
|
# NOTE: no other known values at this time, fallback (assume permits)
|
||||||
case _:
|
case _:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_config(path: Path) -> bool:
|
||||||
|
return path.joinpath("config/config.vdf")
|
||||||
|
|
||||||
def get_client_allows_downloads(path: Path) -> bool:
|
def get_client_allows_downloads(path: Path) -> bool:
|
||||||
config = path.joinpath("config/config.vdf")
|
config = get_config(path)
|
||||||
try:
|
try:
|
||||||
with open(config) as f:
|
with open(config) as f:
|
||||||
settings = vdf.load(f)
|
settings = vdf.load(f)
|
||||||
|
|||||||
Reference in new issue
Block a user