v0.1.0
This commit is contained in:
@@ -232,10 +232,10 @@ class ContextManager(object):
|
||||
def __init__(self, config: ContextManagerConfig):
|
||||
self.config = config
|
||||
|
||||
def print_contexts_list(self) -> None:
|
||||
def list_contexts(self) -> None:
|
||||
print('\n'.join(self.config.get_contexts_list()))
|
||||
|
||||
def load_context(self, context_name: str) -> None:
|
||||
def apply_context(self, context_name: str) -> None:
|
||||
print(f'loading and applying context: "{context_name}"')
|
||||
try:
|
||||
tasks = self.config.get_tasks_for_context(context_name)
|
||||
@@ -284,9 +284,9 @@ class Runner(object):
|
||||
try:
|
||||
ctxmgr = ContextManager(config)
|
||||
if args.command == COMMAND_LIST:
|
||||
ctxmgr.print_contexts_list()
|
||||
ctxmgr.list_contexts()
|
||||
elif args.command == COMMAND_APPLY:
|
||||
ctxmgr.load_context(args.__dict__[COMMAND_CTX_NAME]) # guaranteed to be present by argparse
|
||||
ctxmgr.apply_context(args.__dict__[COMMAND_CTX_NAME]) # guaranteed to be present by argparse
|
||||
except Exception as e:
|
||||
print(f'error executing command:', e)
|
||||
return 3
|
||||
|
||||
Reference in New Issue
Block a user