Added comments

This commit is contained in:
2021-03-14 16:01:15 +01:00
parent d5d8c3f413
commit cbf333564c
15 changed files with 308 additions and 24 deletions

View File

@@ -10,6 +10,11 @@ from cpl_cli.command_model import CommandModel
class CommandHandler(ServiceABC):
def __init__(self, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
"""
Service to handle incoming commands and args
:param runtime:
:param services:
"""
ServiceABC.__init__(self)
self._runtime = runtime
@@ -28,6 +33,12 @@ class CommandHandler(ServiceABC):
self._commands.remove(cmd)
def handle(self, cmd: str, args: list[str]):
"""
Handles incoming commands and args
:param cmd:
:param args:
:return:
"""
for command in self._commands:
if cmd == command.name or cmd in command.aliases:
if command.is_project_needed and not os.path.isfile(os.path.join(self._runtime.working_directory, 'cpl.json')):