From 2af015ddd298bfe9a85a4c97878f2cfa63e6f005 Mon Sep 17 00:00:00 2001 From: Obijuan Date: Wed, 26 Jun 2024 20:40:41 +0200 Subject: [PATCH] icm install: Install multiple packages --- .vscode/launch.json | 2 +- icm/__main__.py | 3 +-- icm/commands/cmd_install.py | 15 ++++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0bdef14..d811265 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -35,7 +35,7 @@ "type": "debugpy", "request": "launch", "program": "icm-run.py", - "args": ["install","iceK"], + "args": ["install","iceK", "iceWires"], //"console": "internalConsole", "console": "integratedTerminal", "justMyCode": true, diff --git a/icm/__main__.py b/icm/__main__.py index 84b9926..dbe1426 100644 --- a/icm/__main__.py +++ b/icm/__main__.py @@ -51,8 +51,7 @@ def info(): @cli.command() -@click.pass_context -@click.argument("coltag", nargs=1) +@click.argument("coltag", nargs=-1) @click.option( "-d", "--dev", is_flag=True, help="Install latest development version" ) diff --git a/icm/commands/cmd_install.py b/icm/commands/cmd_install.py index 22722bf..849eca3 100644 --- a/icm/commands/cmd_install.py +++ b/icm/commands/cmd_install.py @@ -7,10 +7,10 @@ from icm.commons import commons -def main(coltag: str, dev: bool) -> None: +def main(coltags: tuple, dev: bool) -> None: """ENTRY POINT: Install collections - * coltag: Nombre de la coleccion + tag opcional - Ex. iceK, iceK@0.1.4 + * coltag: tupla de nombres de la coleccion + tag opcional + Ex. (iceK, iceK@0.1.4) * dev: Install development version """ @@ -20,14 +20,15 @@ def main(coltag: str, dev: bool) -> None: print() - # -- Install the collection! - install_main(collection, coltag, dev) + # -- Install the collections! + for coltag in coltags: + install_collection(collection, coltag, dev) -def install_main( +def install_collection( collection: commons.Collection, coltag: str, dev: bool = False ) -> None: - """Main function for installing collections + """Main function for installing only one collection * collection: Collection class (context) * coltag: name + version tag (Ex. iceK@0.1.4) * dev: Development flag