From 47e6deb4e91605bc20f45e7050f70899cf5f20f8 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:29:45 -0300 Subject: [PATCH 01/19] separate get_translations() function into own util --- cli/main.py | 35 +++++------------------------------ cli/utils/__init__.py | 0 cli/utils/get_translation.py | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 cli/utils/__init__.py create mode 100644 cli/utils/get_translation.py diff --git a/cli/main.py b/cli/main.py index 834ce8b..a17decb 100644 --- a/cli/main.py +++ b/cli/main.py @@ -4,8 +4,9 @@ import typer from rich import print from InquirerPy import inquirer -from spice.analyze import analyze_file +from spice.analyze import analyze_file +from cli.utils.get_translation import get_translation # initialize typer app = typer.Typer() @@ -19,32 +20,6 @@ # select a file to save the current selected langague (if saved to memory it wont persist between commands) LANG_FILE = os.path.join(CURRENT_DIR, "lang.txt") -# this will load the translations -def get_translation(): - - # read the lang file to see what langague was set by user - if os.path.exists(LANG_FILE): - - # open the lang file - with open(LANG_FILE, "r") as file: - - # read the lang file - lang = file.read().strip() - - - if not lang: - lang = 'en' # if file is empty, default to english - - else: - lang = 'en' # default to English if there is not file but there will always be a file this is just in case ALSO THIS IS SO @icrcode DOESNT COMPLAIN ABOUT MY CODE NOT BEING CLEAN AND WHATEVER - - # this is actually import the translations - try: - return importlib.import_module(f"cli.translations.{lang}").messages - except ModuleNotFoundError: - return importlib.import_module("cli.translations.en").messages # default to English if any errors - - # SPICE SET_LANG COMMAND @@ -96,7 +71,7 @@ def hello(): """ # load translations - messages = get_translation() + messages = get_translation(LANG_FILE) # print the hello message print(messages["welcome"]) @@ -111,7 +86,7 @@ def version(): """ # load translations - messages = get_translation() + messages = get_translation(LANG_FILE) try: # Get the path to setup.py in the parent directory @@ -154,7 +129,7 @@ def analyze( """ # load translations - messages = get_translation() + messages = get_translation(LANG_FILE) # define available stats UPDATE THIS WHEN NEEDED PLEASE !!!!!!!! available_stats = [ diff --git a/cli/utils/__init__.py b/cli/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cli/utils/get_translation.py b/cli/utils/get_translation.py new file mode 100644 index 0000000..e454258 --- /dev/null +++ b/cli/utils/get_translation.py @@ -0,0 +1,27 @@ +import importlib +import os + +# this will load the translations +def get_translation(LANG_FILE): + + # read the lang file to see what langague was set by user + if os.path.exists(LANG_FILE): + + # open the lang file + with open(LANG_FILE, "r") as file: + + # read the lang file + lang = file.read().strip() + + + if not lang: + lang = 'en' # if file is empty, default to english + + else: + lang = 'en' # default to English if there is not file but there will always be a file this is just in case ALSO THIS IS SO @icrcode DOESNT COMPLAIN ABOUT MY CODE NOT BEING CLEAN AND WHATEVER + + # this is actually import the translations + try: + return importlib.import_module(f"cli.translations.{lang}").messages + except ModuleNotFoundError: + return importlib.import_module("cli.translations.en").messages # default to English if any errors From 19b49dfd9e2ec34264228f45c919ed8564fda151 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:30:22 -0300 Subject: [PATCH 02/19] make commands folder a module --- cli/commands/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cli/commands/__init__.py diff --git a/cli/commands/__init__.py b/cli/commands/__init__.py new file mode 100644 index 0000000..e69de29 From 0469c3f87eab8519cdf39e6efd3aca9b0186a185 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:30:56 -0300 Subject: [PATCH 03/19] remove unused import --- cli/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/main.py b/cli/main.py index a17decb..8a7f29d 100644 --- a/cli/main.py +++ b/cli/main.py @@ -1,6 +1,5 @@ import os import sys -import importlib import typer from rich import print from InquirerPy import inquirer From 33f2f6388cce725f96c71183a87db51bfe906783 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:47:09 -0300 Subject: [PATCH 04/19] separate translate command into own file --- cli/commands/translate.py | 39 +++++++++++++++++++++++++++++++++++++++ cli/main.py | 12 ++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 cli/commands/translate.py diff --git a/cli/commands/translate.py b/cli/commands/translate.py new file mode 100644 index 0000000..8e23213 --- /dev/null +++ b/cli/commands/translate.py @@ -0,0 +1,39 @@ +from InquirerPy import inquirer + +def translate(LANG_FILE): + """ + Set the language for CLI messages. + """ + + # LIST OF ALL AVAILIBLE LANGAUGES ADD NEW TRANSLATIONS HERE PLEASE !!!!!!!!!!!!!!!!!!!!!!!! + LANGUAGES = { + "en": {"name": "English"}, + "pt-br": {"name": "Portuguese"}, + "fremen": {"name": "Fremen"}, + # Add more languages as needed + } + + # this just makes the list above actually work (i wanted to add emojis but flag emojies dont work on pc 😭) + choices = [ + f"{info['name']} ({lang})" for lang, info in LANGUAGES.items() + ] + + # intereacitive menu + selected_choice = inquirer.select( + message="Choose a language:", + choices=choices, + pointer="> ", + default="English" + ).execute() + + # will read the dicionary to see what langauggue is which does that make sense? its like the reverse of before + selected_lang = next( + lang for lang, info in LANGUAGES.items() if f"{info['name']} ({lang})" == selected_choice + ) + + # will write the new language to the langague file (to save it to HD instead of memory) (so its persistant between commands) + with open(LANG_FILE, "w") as file: + file.write(selected_lang) + + print(f"[green]Language set to:[/] {selected_lang}") + diff --git a/cli/main.py b/cli/main.py index 8a7f29d..87b30d6 100644 --- a/cli/main.py +++ b/cli/main.py @@ -4,9 +4,21 @@ from rich import print from InquirerPy import inquirer +# this is the analyzer from spice.analyze import analyze_file + +# here we import utilities from cli.utils.get_translation import get_translation +# here we import the commands +def translate_command(): + """ + Set the language for CLI messages. + """ + + translate(LANG_FILE) + + # initialize typer app = typer.Typer() From 01e76806648dfe13dd7ecf14313af774a147dc99 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:49:41 -0300 Subject: [PATCH 05/19] please don't look at the previous commit. it's working now this is all that matters --- cli/commands/translate.py | 2 +- cli/main.py | 39 ++------------------------------------- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/cli/commands/translate.py b/cli/commands/translate.py index 8e23213..ad3284a 100644 --- a/cli/commands/translate.py +++ b/cli/commands/translate.py @@ -1,6 +1,6 @@ from InquirerPy import inquirer -def translate(LANG_FILE): +def translate_command(LANG_FILE): """ Set the language for CLI messages. """ diff --git a/cli/main.py b/cli/main.py index 87b30d6..807439b 100644 --- a/cli/main.py +++ b/cli/main.py @@ -11,12 +11,7 @@ from cli.utils.get_translation import get_translation # here we import the commands -def translate_command(): - """ - Set the language for CLI messages. - """ - - translate(LANG_FILE) +from cli.commands.translate import translate_command # initialize typer @@ -40,37 +35,7 @@ def translate(): Set the language for CLI messages. """ - # LIST OF ALL AVAILIBLE LANGAUGES ADD NEW TRANSLATIONS HERE PLEASE !!!!!!!!!!!!!!!!!!!!!!!! - LANGUAGES = { - "en": {"name": "English"}, - "pt-br": {"name": "Portuguese"}, - "fremen": {"name": "Fremen"}, - # Add more languages as needed - } - - # this just makes the list above actually work (i wanted to add emojis but flag emojies dont work on pc 😭) - choices = [ - f"{info['name']} ({lang})" for lang, info in LANGUAGES.items() - ] - - # intereacitive menu - selected_choice = inquirer.select( - message="Choose a language:", - choices=choices, - pointer="> ", - default="English" - ).execute() - - # will read the dicionary to see what langauggue is which does that make sense? its like the reverse of before - selected_lang = next( - lang for lang, info in LANGUAGES.items() if f"{info['name']} ({lang})" == selected_choice - ) - - # will write the new language to the langague file (to save it to HD instead of memory) (so its persistant between commands) - with open(LANG_FILE, "w") as file: - file.write(selected_lang) - - print(f"[green]Language set to:[/] {selected_lang}") + translate_command(LANG_FILE) From 88baf9426b26694e700cab892a1e3f550c9386e7 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:53:56 -0300 Subject: [PATCH 06/19] separate hello command into own file --- cli/commands/hello.py | 14 ++++++++++++++ cli/main.py | 8 ++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 cli/commands/hello.py diff --git a/cli/commands/hello.py b/cli/commands/hello.py new file mode 100644 index 0000000..4cd73a9 --- /dev/null +++ b/cli/commands/hello.py @@ -0,0 +1,14 @@ + +from rich import print # this add colors to the printed text + +from cli.utils.get_translation import get_translation + + +def hello_command(LANG_FILE): + + # load translations + messages = get_translation(LANG_FILE) + + # print the hello message + print(messages["welcome"]) + print(messages["description"]) \ No newline at end of file diff --git a/cli/main.py b/cli/main.py index 807439b..285688f 100644 --- a/cli/main.py +++ b/cli/main.py @@ -12,6 +12,7 @@ # here we import the commands from cli.commands.translate import translate_command +from cli.commands.hello import hello_command # initialize typer @@ -46,12 +47,7 @@ def hello(): Welcome message. """ - # load translations - messages = get_translation(LANG_FILE) - - # print the hello message - print(messages["welcome"]) - print(messages["description"]) + hello_command(LANG_FILE) # SPICE VERSION COMMAND From 701cd1a16f16fab08df443f1efa26d5ffb202ff1 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:54:20 -0300 Subject: [PATCH 07/19] fix comment typo --- cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/main.py b/cli/main.py index 285688f..a7bdc6f 100644 --- a/cli/main.py +++ b/cli/main.py @@ -29,7 +29,7 @@ -# SPICE SET_LANG COMMAND +# SPICE TRANSLATE COMMAND @app.command() def translate(): """ From dea4e003c969ddac3098a35ae45acef120962847 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 19:54:57 -0300 Subject: [PATCH 08/19] skip an extra line for better organization and readability --- cli/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/main.py b/cli/main.py index a7bdc6f..6c48a2e 100644 --- a/cli/main.py +++ b/cli/main.py @@ -50,6 +50,7 @@ def hello(): hello_command(LANG_FILE) + # SPICE VERSION COMMAND @app.command() def version(): From 3a47f54e3e698c3d64a8e27073416a452627e74d Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:01:33 -0300 Subject: [PATCH 09/19] separate version command into own file --- cli/commands/version.py | 40 ++++++++++++++++++++++++++++++++++++++++ cli/main.py | 32 ++------------------------------ 2 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 cli/commands/version.py diff --git a/cli/commands/version.py b/cli/commands/version.py new file mode 100644 index 0000000..3eb2359 --- /dev/null +++ b/cli/commands/version.py @@ -0,0 +1,40 @@ +import os +from rich import print # this add colors to the printed text +from cli.utils.get_translation import get_translation + + +def version_command(LANG_FILE, CURRENT_DIR): + """ + Display the current version of the application. + """ + + # load translations + messages = get_translation(LANG_FILE) + + try: + # Get the path to setup.py in the parent directory + setup_path = os.path.join(os.path.dirname(CURRENT_DIR), "setup.py") + + # Check if setup.py exists + if not os.path.exists(setup_path): + print(f"[red]{messages.get('setup_not_found', 'Error: setup.py not found.')}") + return + + # Read setup.py to extract version + version_info = None + with open(setup_path, "r") as file: + for line in file: + if line.strip().startswith("version="): + # Extract version using string manipulation + version_line = line.strip() + version_info = version_line.split("=")[1].strip().strip('"').strip("'").strip(",") + break + + # Display version information + if version_info: + print(f"[green]{messages.get('version_info', 'Version:')}[/] {version_info}") + else: + print(f"[yellow]{messages.get('version_not_found', 'Version information not found in setup.py')}") + + except Exception as e: + print(f"[red]{messages.get('error', 'Error:')}[/] {e}") \ No newline at end of file diff --git a/cli/main.py b/cli/main.py index 6c48a2e..688cc1e 100644 --- a/cli/main.py +++ b/cli/main.py @@ -13,6 +13,7 @@ # here we import the commands from cli.commands.translate import translate_command from cli.commands.hello import hello_command +from cli.commands.version import version_command # initialize typer @@ -58,36 +59,7 @@ def version(): Display the current version of the application. """ - # load translations - messages = get_translation(LANG_FILE) - - try: - # Get the path to setup.py in the parent directory - setup_path = os.path.join(os.path.dirname(CURRENT_DIR), "setup.py") - - # Check if setup.py exists - if not os.path.exists(setup_path): - print(f"[red]{messages.get('setup_not_found', 'Error: setup.py not found.')}") - return - - # Read setup.py to extract version - version_info = None - with open(setup_path, "r") as file: - for line in file: - if line.strip().startswith("version="): - # Extract version using string manipulation - version_line = line.strip() - version_info = version_line.split("=")[1].strip().strip('"').strip("'").strip(",") - break - - # Display version information - if version_info: - print(f"[green]{messages.get('version_info', 'Version:')}[/] {version_info}") - else: - print(f"[yellow]{messages.get('version_not_found', 'Version information not found in setup.py')}") - - except Exception as e: - print(f"[red]{messages.get('error', 'Error:')}[/] {e}") + version_command(LANG_FILE, CURRENT_DIR) # SPICE ANALYZE COMMAND From f966145d3b1a270fb36ed001601d5082e077bc42 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:06:10 -0300 Subject: [PATCH 10/19] update version text --- cli/commands/version.py | 2 +- cli/translations/en.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands/version.py b/cli/commands/version.py index 3eb2359..b4baed9 100644 --- a/cli/commands/version.py +++ b/cli/commands/version.py @@ -32,7 +32,7 @@ def version_command(LANG_FILE, CURRENT_DIR): # Display version information if version_info: - print(f"[green]{messages.get('version_info', 'Version:')}[/] {version_info}") + print(f"[green]{messages.get('version_info', 'SpiceCode Version:')}[/] {version_info}") else: print(f"[yellow]{messages.get('version_not_found', 'Version information not found in setup.py')}") diff --git a/cli/translations/en.py b/cli/translations/en.py index 9f44294..0e3973a 100644 --- a/cli/translations/en.py +++ b/cli/translations/en.py @@ -18,7 +18,7 @@ "confirm_and_analyze": "Confirm and analyze", "checkbox_hint": "(Use space to select, enter to confirm)", # keys for the version command - "version_info": "Version:", + "version_info": "SpiceCode Version:", "version_not_found": "Version information not found in setup.py", "setup_not_found": "Error: setup.py not found." } \ No newline at end of file From 5e7f95e667c0b85686d049e7c974aa9501a84ed6 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:07:42 -0300 Subject: [PATCH 11/19] this one will be tough --- cli/commands/analyze.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cli/commands/analyze.py diff --git a/cli/commands/analyze.py b/cli/commands/analyze.py new file mode 100644 index 0000000..e69de29 From 542dfc09e398ff0b781deb7e9981cffd954d4948 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:11:30 -0300 Subject: [PATCH 12/19] HOLY SHIT ITS WORKING --- cli/commands/analyze.py | 89 +++++++++++++++++++++++++++++++++++++++++ cli/main.py | 77 +---------------------------------- 2 files changed, 91 insertions(+), 75 deletions(-) diff --git a/cli/commands/analyze.py b/cli/commands/analyze.py index e69de29..46a741c 100644 --- a/cli/commands/analyze.py +++ b/cli/commands/analyze.py @@ -0,0 +1,89 @@ + +from InquirerPy import inquirer + +from cli.utils.get_translation import get_translation +from spice.analyze import analyze_file + + + +def analyze_command(file, all, json_output, LANG_FILE): + """ + Analyze the given file. + """ + + # load translations + messages = get_translation(LANG_FILE) + + # define available stats UPDATE THIS WHEN NEEDED PLEASE !!!!!!!! + available_stats = [ + "line_count", + "function_count", + "comment_line_count" + ] + + # dictionary for the stats UPDATE THIS WHEN NEEDED PLEASE !!!!!!!! + stats_labels = { + "line_count": messages.get("line_count_option", "Line Count"), + "function_count": messages.get("function_count_option", "Function Count"), + "comment_line_count": messages.get("comment_line_count_option", "Comment Line Count") + } + + # If --all flag is used, skip the selection menu and use all stats + if all: + selected_stat_keys = available_stats + else: + # Don't show interactive menu in JSON mode (assumes all stats) + if json_output: + selected_stat_keys = available_stats + else: + # print checkbox menu to select which stats to show + selected_stats = inquirer.checkbox( + message=messages.get("select_stats", "Select stats to display:"), + choices=[stats_labels[stat] for stat in available_stats], + pointer="> ", + default=[stats_labels[stat] for stat in available_stats], # All selected by default + instruction=messages.get("checkbox_hint", "(Use space to select, enter to confirm)") + ).execute() + + # if no stats were selected + if not selected_stats: + if json_output: + import json + print(json.dumps({"error": messages.get("no_stats_selected", "No stats selected. Analysis cancelled.")})) + else: + print(messages.get("no_stats_selected", "No stats selected. Analysis cancelled.")) + return + + # create a mapping from displayed labels back to stat keys + reverse_mapping = {v: k for k, v in stats_labels.items()} + + # convert selected labels back to stat keys + selected_stat_keys = [reverse_mapping[label] for label in selected_stats] + + # try to analyze and if error then print the error + try: + # show analyzing message if not in JSON mode + if not json_output: + print(f"{messages['analyzing_file']}: {file}") + + # get analysis results from analyze_file + results = analyze_file(file, selected_stats=selected_stat_keys) + + # output in JSON format if flag + if json_output: + import json + print(json.dumps(results, indent=2)) + else: + # only print the selected stats in normal mode + for stat in selected_stat_keys: + if stat in results: + print(messages[stat].format(count=results[stat])) + + except Exception as e: + if json_output: + import json + # Replace newlines with spaces or escape them properly + error_msg = str(e).replace('\n', ' ') + print(json.dumps({"error": error_msg})) + else: + print(f"[red]{messages['error']}[/] {e}") diff --git a/cli/main.py b/cli/main.py index 688cc1e..c24a90a 100644 --- a/cli/main.py +++ b/cli/main.py @@ -14,6 +14,7 @@ from cli.commands.translate import translate_command from cli.commands.hello import hello_command from cli.commands.version import version_command +from cli.commands.analyze import analyze_command # initialize typer @@ -73,82 +74,8 @@ def analyze( Analyze the given file. """ - # load translations - messages = get_translation(LANG_FILE) - - # define available stats UPDATE THIS WHEN NEEDED PLEASE !!!!!!!! - available_stats = [ - "line_count", - "function_count", - "comment_line_count" - ] - - # dictionary for the stats UPDATE THIS WHEN NEEDED PLEASE !!!!!!!! - stats_labels = { - "line_count": messages.get("line_count_option", "Line Count"), - "function_count": messages.get("function_count_option", "Function Count"), - "comment_line_count": messages.get("comment_line_count_option", "Comment Line Count") - } + analyze_command(file, all, json_output, LANG_FILE) - # If --all flag is used, skip the selection menu and use all stats - if all: - selected_stat_keys = available_stats - else: - # Don't show interactive menu in JSON mode (assumes all stats) - if json_output: - selected_stat_keys = available_stats - else: - # print checkbox menu to select which stats to show - selected_stats = inquirer.checkbox( - message=messages.get("select_stats", "Select stats to display:"), - choices=[stats_labels[stat] for stat in available_stats], - pointer="> ", - default=[stats_labels[stat] for stat in available_stats], # All selected by default - instruction=messages.get("checkbox_hint", "(Use space to select, enter to confirm)") - ).execute() - - # if no stats were selected - if not selected_stats: - if json_output: - import json - print(json.dumps({"error": messages.get("no_stats_selected", "No stats selected. Analysis cancelled.")})) - else: - print(messages.get("no_stats_selected", "No stats selected. Analysis cancelled.")) - return - - # create a mapping from displayed labels back to stat keys - reverse_mapping = {v: k for k, v in stats_labels.items()} - - # convert selected labels back to stat keys - selected_stat_keys = [reverse_mapping[label] for label in selected_stats] - - # try to analyze and if error then print the error - try: - # show analyzing message if not in JSON mode - if not json_output: - print(f"{messages['analyzing_file']}: {file}") - - # get analysis results from analyze_file - results = analyze_file(file, selected_stats=selected_stat_keys) - - # output in JSON format if flag - if json_output: - import json - print(json.dumps(results, indent=2)) - else: - # only print the selected stats in normal mode - for stat in selected_stat_keys: - if stat in results: - print(messages[stat].format(count=results[stat])) - - except Exception as e: - if json_output: - import json - # Replace newlines with spaces or escape them properly - error_msg = str(e).replace('\n', ' ') - print(json.dumps({"error": error_msg})) - else: - print(f"[red]{messages['error']}[/] {e}") def main(): From da27ad0dc67f02428807acc54166b7edfde21026 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:11:47 -0300 Subject: [PATCH 13/19] improve readability --- cli/commands/analyze.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/commands/analyze.py b/cli/commands/analyze.py index 46a741c..910eaca 100644 --- a/cli/commands/analyze.py +++ b/cli/commands/analyze.py @@ -1,11 +1,9 @@ - from InquirerPy import inquirer from cli.utils.get_translation import get_translation from spice.analyze import analyze_file - def analyze_command(file, all, json_output, LANG_FILE): """ Analyze the given file. From df3aac59db067151222ff6d18b8695088cb0d059 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:12:08 -0300 Subject: [PATCH 14/19] maybe i should split this file into more files ill use this commit as a reminder todo list --- cli/commands/analyze.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/commands/analyze.py b/cli/commands/analyze.py index 910eaca..cb47993 100644 --- a/cli/commands/analyze.py +++ b/cli/commands/analyze.py @@ -85,3 +85,4 @@ def analyze_command(file, all, json_output, LANG_FILE): print(json.dumps({"error": error_msg})) else: print(f"[red]{messages['error']}[/] {e}") + From 6bf9c6a7d2d26d921fb775aaa559dfd855c9af5f Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:12:44 -0300 Subject: [PATCH 15/19] improve readability --- cli/commands/hello.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/commands/hello.py b/cli/commands/hello.py index 4cd73a9..f58f7a9 100644 --- a/cli/commands/hello.py +++ b/cli/commands/hello.py @@ -1,4 +1,3 @@ - from rich import print # this add colors to the printed text from cli.utils.get_translation import get_translation From 7cf00e1ef7052e0b82904e8c024c1b1143d876d4 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:12:56 -0300 Subject: [PATCH 16/19] improve readability --- cli/commands/translate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/commands/translate.py b/cli/commands/translate.py index ad3284a..a9a00df 100644 --- a/cli/commands/translate.py +++ b/cli/commands/translate.py @@ -1,5 +1,6 @@ from InquirerPy import inquirer + def translate_command(LANG_FILE): """ Set the language for CLI messages. From c37c154afda5dc94652ea5e89e57808896e423dc Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:13:13 -0300 Subject: [PATCH 17/19] improve readability --- cli/commands/version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/commands/version.py b/cli/commands/version.py index b4baed9..2e9111e 100644 --- a/cli/commands/version.py +++ b/cli/commands/version.py @@ -1,5 +1,6 @@ import os from rich import print # this add colors to the printed text + from cli.utils.get_translation import get_translation From a648b7ea13a617ca6551e92f96c96ca4c3e07921 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:19:40 -0300 Subject: [PATCH 18/19] tried to make python less discusting --- cli/main.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cli/main.py b/cli/main.py index c24a90a..f721c10 100644 --- a/cli/main.py +++ b/cli/main.py @@ -40,6 +40,7 @@ def translate(): translate_command(LANG_FILE) +# -- end -- # # SPICE HELLO COMMAND @@ -51,6 +52,7 @@ def hello(): hello_command(LANG_FILE) +# -- end -- # # SPICE VERSION COMMAND @@ -62,6 +64,8 @@ def version(): version_command(LANG_FILE, CURRENT_DIR) +#--- end ---# + # SPICE ANALYZE COMMAND @app.command() @@ -75,12 +79,18 @@ def analyze( """ analyze_command(file, all, json_output, LANG_FILE) - + +# -- end -- # def main(): app() # run typer +# -- end -- # + + # whatever the fuck this is python makes no sense if __name__ == "__main__": - main() \ No newline at end of file + main() + +# -- end -- # \ No newline at end of file From 6340fd8b58133fcf2ac96f7a4390ce94594ad6e8 Mon Sep 17 00:00:00 2001 From: ManfredHair Date: Thu, 13 Mar 2025 20:21:42 -0300 Subject: [PATCH 19/19] remove unused imports --- cli/main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/main.py b/cli/main.py index f721c10..a452d9c 100644 --- a/cli/main.py +++ b/cli/main.py @@ -1,8 +1,6 @@ import os import sys import typer -from rich import print -from InquirerPy import inquirer # this is the analyzer from spice.analyze import analyze_file