Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions app/commands/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@
from .file import file_resume

# Import custom commands
from .kg_resource import kg_resource
from .project import project_list_all
from .use_config import set_env
from .user import login
from .user import logout

kg_enabled = os.environ.get('PILOT_CLI_KG_ENABLED', 'false') == 'true'
container_registry_enabled = os.environ.get('PILOT_CLI_CONTAINER_REGISTRY_ENABLED', 'false') == 'true'


def command_groups():
commands = ['file', 'user', 'use_config', 'project', 'dataset', 'container_registry']
if kg_enabled:
commands.append('kg_resource')
commands = ['file', 'user', 'use_config', 'project', 'dataset']
if container_registry_enabled:
commands.append('container_registry')
return commands


Expand Down Expand Up @@ -78,12 +77,6 @@ def config_group():
pass


@entry_point.group(name='container_registry')
@require_config
def cr_group():
pass


file_group.add_command(file_put)
file_group.add_command(file_check_manifest)
file_group.add_command(file_export_manifest)
Expand All @@ -96,18 +89,18 @@ def cr_group():
dataset_group.add_command(dataset_list)
dataset_group.add_command(dataset_show_detail)
dataset_group.add_command(dataset_download)
cr_group.add_command(list_projects)
cr_group.add_command(list_repositories)
cr_group.add_command(create_project)
cr_group.add_command(get_secret)
cr_group.add_command(invite_member)
config_group.add_command(set_env)

# Custom commands
if kg_enabled:
if container_registry_enabled:

@entry_point.group(name='kg_resource')
def kg_resource_group():
@entry_point.group(name='container_registry')
@require_config
def cr_group():
pass

kg_resource_group.add_command(kg_resource)
cr_group.add_command(list_projects)
cr_group.add_command(list_repositories)
cr_group.add_command(create_project)
cr_group.add_command(get_secret)
cr_group.add_command(invite_member)
23 changes: 0 additions & 23 deletions app/commands/kg_resource.py

This file was deleted.

4 changes: 0 additions & 4 deletions app/resources/custom_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ class HelpPage:
'SET_CONFIG': 'Chose config file and set for cli.',
'CONFIG_DESTINATION': 'The destination the config file goes to, default will be current cli directory.',
},
'knowledge_graph': {
'KG_IMPORT': 'Import dataset schema into BlueBrainNexus ',
'KG_DATASET_CODE': 'The dataset code',
},
'container_registry': {
'LIST_PROJECTS': 'List all projects',
'LIST_REPOSITORIES': 'List all repositories (optionally: in a given project)',
Expand Down
89 changes: 0 additions & 89 deletions app/services/kg_manager/kg_resource.py

This file was deleted.

5 changes: 0 additions & 5 deletions app/services/output_manager/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,3 @@ def customized_handle(customized_error: ECustomizedError, if_exit=False, value=N
logger.error(customized_error_msg(customized_error))
if if_exit:
sys.exit(0)


class OverSizeError(Exception):
def __init__(self, message='File size is too large'):
super().__init__(message)
12 changes: 1 addition & 11 deletions app/services/output_manager/help_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ def file_help_page(FileHELP: FileHELP):
return helps.get(FileHELP.name)


class KgResourceHELP(enum.Enum):
KG_IMPORT = 'KG_IMPORT'
KG_DATASET_CODE = 'KG_DATASET_CODE'


def kg_resource_help_page(KgResourceHELP: KgResourceHELP):
helps = help_msg.get('knowledge_graph', 'default kg help')
return helps.get(KgResourceHELP.name)


class ContainerRegistryHELP(enum.Enum):
LIST_PROJECTS = 'LIST_PROJECTS'
LIST_REPOSITORIES = 'LIST_REPOSITORIES'
Expand All @@ -108,5 +98,5 @@ class ContainerRegistryHELP(enum.Enum):


def cr_help_page(ContainerRegistryHELP: ContainerRegistryHELP):
helps = help_msg.get('container_registry', 'default kg help')
helps = help_msg.get('container_registry', 'default container_registry help')
return helps.get(ContainerRegistryHELP.name)
172 changes: 0 additions & 172 deletions tests/app/services/kg_manager/test_kg_manager.py

This file was deleted.