From ae40fb7edad46531086c988c6132de38beefd36f 2019-09-30 19:59:11 From: jespinoza Date: 2019-09-30 19:59:11 Subject: [PATCH] Bug in CLI --- diff --git a/schainpy/cli/cli.py b/schainpy/cli/cli.py index 9f53be8..c1546ce 100644 --- a/schainpy/cli/cli.py +++ b/schainpy/cli/cli.py @@ -46,7 +46,7 @@ def getOperations(): def getArgs(op): module = locate('schainpy.model.{}'.format(op)) - if hasattr(module, '__attrs'): + if hasattr(module, '__attrs__'): args = module.__attrs__ else: args = inspect.getargspec(module.run).args @@ -148,7 +148,8 @@ def search(nextcommand): if nextcommand is None: log.error('There is no Operation/ProcessingUnit to search', '') else: - try: + #try: + if True: args = getArgs(nextcommand) doc = getDoc(nextcommand) if len(args) == 0: @@ -156,11 +157,11 @@ def search(nextcommand): else: log.success('{}\n{}\n\narguments:\n {}'.format( nextcommand, doc, ', '.join(args)), '') - except Exception as e: - log.error('Module `{}` does not exists'.format(nextcommand), '') - allModules = getAll() - similar = [t[0] for t in process.extract(nextcommand, allModules, limit=12) if t[1]>80] - log.success('Possible modules are: {}'.format(', '.join(similar)), '') + # except Exception as e: + # log.error('Module `{}` does not exists'.format(nextcommand), '') + # allModules = getAll() + # similar = [t[0] for t in process.extract(nextcommand, allModules, limit=12) if t[1]>80] + # log.success('Possible modules are: {}'.format(', '.join(similar)), '') def runschain(nextcommand): if nextcommand is None: