diff --git a/meta/__init__.py b/meta/__init__.py index 6c6f083..a071f2b 100644 --- a/meta/__init__.py +++ b/meta/__init__.py @@ -1,5 +1,5 @@ __author__="steve l. nyemba" -__version__="1.0" +__version__="1.1" __app_name__="plugin-ix" __license__=""" Copyright 2025, Steve L. Nyemba diff --git a/plugin_ix/cli.py b/plugin_ix/cli.py index 044b126..a4e23d2 100755 --- a/plugin_ix/cli.py +++ b/plugin_ix/cli.py @@ -52,21 +52,23 @@ def inspect (file: Annotated[str,typer.Argument(help="python file that contains @appr.command(name="add") def add_registry( - python_file: Annotated[str,typer.Argument(help="python file that contains functions to be used as plugins")], - registry_folder:str=typer.Option(default=os.environ.get('REGISTRY_FOLDER',None),help="path of the plugin registry folder") + file: Annotated[str,typer.Argument(help="python file that contains functions to be used as plugins")], + folder:str=typer.Option(default=os.environ.get('REGISTRY_FOLDER',None),help="path to the registry folder"), + decorator:str=typer.Option(default=None,help="decorator attribute name (if any) ") ): """ This function will add/override a file to the registry """ # reg = plugin_ix.Registry(rg_file) - loader = plugin_ix.Loader(file=python_file) + loader = plugin_ix.Loader() #(file=file) + loader.load(file=file,decorator=decorator) if loader.get() : _names = list(loader.get().keys()) - reg = plugin_ix.Registry(registry_folder) - reg.set(python_file,_names) + reg = plugin_ix.Registry(folder) + reg.set(file,_names) print (f"""{CHECK_MARK} Import was [bold]successful[/bold] into {reg._folder}""") else: - print (f"""{TIMES_MARK} Import [bold]Failed[/bold] into {registry_folder}, please consider setting environment REGISTRY_FOLDER """) + print (f"""{TIMES_MARK} Import [bold]Failed[/bold] into {folder}, please consider setting environment REGISTRY_FOLDER """) def to_Table(df: pd.DataFrame): """Displays a Pandas DataFrame as a rich table."""