Fix command detection and improve weather timing

This commit is contained in:
2026-02-02 23:30:57 +03:00
parent 845ef7c531
commit a61f526ce4
5 changed files with 38 additions and 18 deletions

View File

@@ -74,19 +74,23 @@ def _command_exists(command):
True, если команда существует
"""
try:
subprocess.run(["which", command],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=False)
return True
result = subprocess.run(
["which", command],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=False,
)
return result.returncode == 0
except:
try:
# Альтернативная проверка для Windows
subprocess.run(["where", command],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=False)
return True
result = subprocess.run(
["where", command],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=False,
)
return result.returncode == 0
except:
return False