enable simple way to list ensembles in CLI
This commit is contained in:
parent
ecad536c9e
commit
bd1468ad8f
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,8 @@ from .initialization import create
|
||||||
from .toml import import_toml, update_project
|
from .toml import import_toml, update_project
|
||||||
from .find import find_record, find_project, list_projects
|
from .find import find_record, find_project, list_projects
|
||||||
from .tools import str2list
|
from .tools import str2list
|
||||||
|
import os
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer()
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,9 +44,13 @@ def list(
|
||||||
List entities. (ensembles, projects)
|
List entities. (ensembles, projects)
|
||||||
"""
|
"""
|
||||||
if entities in ['ensembles', 'Ensembles','ENSEMBLES']:
|
if entities in ['ensembles', 'Ensembles','ENSEMBLES']:
|
||||||
results = "List of ensembles"
|
print("Ensembles:")
|
||||||
|
for item in os.listdir(path + "/archive"):
|
||||||
|
if os.path.isdir(os.path.join(path + "/archive", item)):
|
||||||
|
print(item)
|
||||||
elif entities == 'projects':
|
elif entities == 'projects':
|
||||||
results = list_projects(path)
|
results = list_projects(path)
|
||||||
|
print("Projects:")
|
||||||
header = "UUID".ljust(37) + "| Names"
|
header = "UUID".ljust(37) + "| Names"
|
||||||
print(header)
|
print(header)
|
||||||
for project in results:
|
for project in results:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue