This commit is contained in:
BarsTiger
2022-02-24 08:33:34 +02:00
parent aadb48c2b6
commit 2278bde59c
5 changed files with 9 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ if __name__ == "__main__":
ui.username_box.setText(loginload()) ui.username_box.setText(loginload())
# Functions # Connected functions
def refresh_gui(): def refresh_gui():
installed_apps() installed_apps()

View File

@@ -1,3 +1,6 @@
# Idea from rich examples
# https://github.com/Textualize/rich/blob/master/examples/downloader.py
import os.path import os.path
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
import signal import signal

View File

@@ -97,6 +97,9 @@ codes = {'CONTINUE': 100,
} }
def handle(code): def handle(code) -> list:
"""Prints and the status code in another way and code from args.
If it was number code returns list with message and code and if it was string code
returns list with code and message"""
print(codes[code]) print(codes[code])
return [codes[code], code] return [codes[code], code]

View File

@@ -29,7 +29,6 @@ def install(package):
os.makedirs('{1}apps\{0}'.format(r['name'], horsy_vars.horsypath)) os.makedirs('{1}apps\{0}'.format(r['name'], horsy_vars.horsypath))
# Get all download files urls # Get all download files urls
print(f"Downloading {r['url'].split('/')[-1]}")
to_download = [r['url']] to_download = [r['url']]
if r['download']: if r['download']:
print(f"Found dependency") print(f"Found dependency")

View File

@@ -3,4 +3,4 @@ import os
protocol = "https://" protocol = "https://"
server_url = 'horsy.ml' server_url = 'horsy.ml'
horsypath = os.popen('echo %HORSYPATH%').read().replace('\n', '') + '/' horsypath = os.popen('echo %HORSYPATH%').read().replace('\n', '') + '\\'