mirror of
https://github.com/aclist/dztui.git
synced 2026-08-25 17:32:36 +02:00
chore: simplify control flow
Some checks are pending
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
Some checks are pending
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run
This commit is contained in:
parent
120703e702
commit
5532e4e267
@ -22,9 +22,11 @@ def is_map_count_valid(count: int | None) -> bool:
|
|||||||
|
|
||||||
def get_map_count() -> int | None:
|
def get_map_count() -> int | None:
|
||||||
path = Path(VM_FILE)
|
path = Path(VM_FILE)
|
||||||
if path.is_file() is False:
|
try:
|
||||||
return None
|
|
||||||
count = int(path.read_text())
|
count = int(path.read_text())
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(e)
|
||||||
|
return None
|
||||||
return count
|
return count
|
||||||
|
|
||||||
|
|
||||||
@ -38,11 +40,10 @@ def test_map_count() -> None:
|
|||||||
|
|
||||||
def set_map_count() -> None:
|
def set_map_count() -> None:
|
||||||
count = get_map_count()
|
count = get_map_count()
|
||||||
valid = is_map_count_valid(count)
|
|
||||||
if count is None:
|
if count is None:
|
||||||
print(map_count.failed_to_parse)
|
print(map_count.failed_to_parse)
|
||||||
return
|
return
|
||||||
elif valid:
|
if is_map_count_valid(count):
|
||||||
msg = map_count.meets_minimum.format(count)
|
msg = map_count.meets_minimum.format(count)
|
||||||
print(msg)
|
print(msg)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user