Added search function

This commit is contained in:
Neocky
2022-06-16 22:35:54 +02:00
parent e229324117
commit d427886c49
5 changed files with 67 additions and 17 deletions

View File

@@ -11,9 +11,9 @@ from rich.console import Console
class config_value():
"""
Class which holds all the available configuration values from the config file and which will be used later in
the process of updating plugins
If bool in config can't be read it will default to 'False'
Class which holds all the available configuration values from the config file and which will be used later in
the process of updating plugins
If bool in config can't be read it will default to 'False'
"""
def __init__(self):
yaml = ruamel.yaml.YAML()
@@ -35,8 +35,8 @@ class config_value():
def check_config() -> None:
"""
Check if there is a pluGET_config.yml file in the same folder as pluget.py and if not create a new config
and exit the programm
Check if there is a pluGET_config.yml file in the same folder as pluget.py and if not create a new config
and exit the programm
"""
if not os.path.isfile("pluGET_config.yaml"):
create_config()
@@ -44,7 +44,7 @@ def check_config() -> None:
def create_config() -> None:
"""
Creates the yaml config in the current directory with the filename pluGET_config.yml
Creates the yaml config in the current directory with the filename pluGET_config.yml
"""
# this is the whole yaml code because of weird formating indention is not possible
configuration = """\
@@ -90,7 +90,7 @@ def create_config() -> None:
def validate_config() -> None:
"""
Validates the config variables after config class is loaded and exit if error is detected and print error
Validates the config variables after config class is loaded and exit if error is detected and print error
"""
accepted_values = [
("local", "sftp", "ftp")

View File

@@ -3,7 +3,7 @@ Handles the input through the pluGET command line
"""
from src.utils.console_output import rich_print_error
from src.plugin.plugin_downloader import get_specific_plugin
from src.plugin.plugin_downloader import get_specific_plugin, search_specific_plugin
# check
@@ -60,8 +60,7 @@ def handle_input(input_command=None, input_selected_object=None, input_parameter
#checkInstalledPackage(inputSelectedObject, inputParams)
case "search":
print("search package")
#searchPackage(inputSelectedObject)
search_specific_plugin(input_selected_object)
case "remove":
print("remove package")
#removePlugin(inputSelectedObject)
@@ -85,7 +84,7 @@ def get_input() -> None:
Gets command line input and calls the handle input function
"""
input_command = None
print("'STRG + C' to exit")
print("\n'STRG + C' to exit")
while True:
try:
input_command, input_selected_object, *input_parameter = input("pluGET >> ").split()