mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
This commit is contained in:
1 parent
120703e702
commit
5532e4e267
1 file changed
+5
-4
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user