From 7fe161fc42f006d2ee24fe648b567f369836de22 Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Sun, 27 Feb 2022 19:41:57 +0200 Subject: [PATCH] Update startup --- horsy.py | 38 ++++++++++++++++++++++---------------- modules/console.py | 4 ++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/horsy.py b/horsy.py index 0faab2e..fccde4b 100644 --- a/horsy.py +++ b/horsy.py @@ -21,19 +21,8 @@ args = parser.parse_args() option = args.option app = args.app -# Displaying the logo +# Window title os.system('title horsy') -cls() -print(''' - __ __ _______ ______ _______ __ __ -| | | || || _ | | || | | | -| |_| || _ || | || | _____|| |_| | -| || | | || |_||_ | |_____ | | -| || |_| || __ ||_____ ||_ _| -| _ || || | | | _____| | | | -|__| |__||_______||___| |_||_______| |___| - Search powered by Algolia -''') # Checking directories and files if not os.path.exists(horsy_vars.horsypath + 'apps'): @@ -60,6 +49,22 @@ except: isNoArgs = False + +# Function to display logo +def log_logo(): + cls() + print(''' + __ __ _______ ______ _______ __ __ +| | | || || _ | | || | | | +| |_| || _ || | || | _____|| |_| | +| || | | || |_||_ | |_____ | | +| || |_| || __ ||_____ ||_ _| +| _ || || | | | _____| | | | +|__| |__||_______||___| |_||_______| |___| + Search powered by Algolia + ''') + + # Checking if the user has a new VT key if args.vt_key: if args.vt_key != 'disable': @@ -72,15 +77,16 @@ if args.vt_key: # Checking if arguments are empty to use in-app CLI if not args.option: + log_logo() option = ['install', 'uninstall', 'source', 'list', 'upload', 'search', 'info'][ tui.menu(['install app', 'uninstall app', 'get source', 'list of installed apps', 'upload your app', 'search for app', 'get information about app'])] isNoArgs = True -if not args.app: - if option not in ['list', 'upload', 'update']: - print('\n') - app = tui.get(f'Select app to {option}') +if not args.app and option not in ['list', 'upload', 'update']: + log_logo() + print('\n') + app = tui.get(f'Select app to {option}') # Checking user option (Yanderedev method) if option in ['upload']: diff --git a/modules/console.py b/modules/console.py index d2807c7..8c71fb5 100644 --- a/modules/console.py +++ b/modules/console.py @@ -3,3 +3,7 @@ import os def cls(): os.system('cls' if os.name == 'nt' else 'clear') + + +def softcls(): + print('\n' * os.get_terminal_size().lines)