Merge branch 'main' into dev

This commit is contained in:
WhatDidYouExpect 2025-07-07 23:42:07 +02:00 committed by GitHub
commit a04159b3a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 18 additions and 16 deletions

View file

@ -70,7 +70,7 @@ def register_name(NAME):
if os.getenv("gooberTOKEN"):
return
# Name taken: print error and exit
print(f"{RED}{(_('name_taken'))}{gv.RESET}")
print(f"{gv.RED}{(_('name_taken'))}{gv.RESET}")
quit()
# Register the name
response = requests.post(f"{gv.VERSION_URL}/register", json={"name": NAME}, headers={"Content-Type": "application/json"})

View file

@ -127,7 +127,7 @@ def check_requirements():
"token": gooberTOKEN
}
try:
requests.post(VERSION_URL + "/ping", json=payload)
requests.post(VERSION_URL + "/ping", json=payload) # type: ignore
except Exception as e:
print(f"{RED}{(_('failed_to_contact')).format(url=VERSION_URL, error=e)}{RESET}")
sys.exit(1)
@ -173,7 +173,7 @@ def check_memory():
if psutilavaliable == False:
return
try:
memory_info = psutil.virtual_memory()
memory_info = psutil.virtual_memory() # type: ignore
total_memory = memory_info.total / (1024 ** 3)
used_memory = memory_info.used / (1024 ** 3)
free_memory = memory_info.available / (1024 ** 3)
@ -193,7 +193,7 @@ def check_cpu():
if psutilavaliable == False:
return
print((_('measuring_cpu')))
cpu_per_core = psutil.cpu_percent(interval=1, percpu=True)
cpu_per_core = psutil.cpu_percent(interval=1, percpu=True) # type: ignore
for idx, core_usage in enumerate(cpu_per_core):
bar_length = int(core_usage / 5)
bar = '' * bar_length + '-' * (20 - bar_length)