##// END OF EJS Templates
errores mejorados
José Chávez -
r945:f9b2d290f79c
parent child
Show More
@@ -67,7 +67,6 def clean_modules(module):
67 67
68 68
69 69 def search(nextcommand):
70
71 70 if nextcommand is None:
72 71 log.error('There is no Operation/ProcessingUnit to search')
73 72 elif nextcommand == 'procs':
@@ -91,8 +90,8 def search(nextcommand):
91 90 else:
92 91 try:
93 92 module = locate('schainpy.model.{}'.format(nextcommand))
94 log.warning('Use this feature with caution. It may not return all the allowed arguments')
95 93 args = module().getAllowedArgs()
94 log.warning('Use this feature with caution. It may not return all the allowed arguments')
96 95 try:
97 96 args.remove('self')
98 97 except Exception as e:
@@ -101,13 +100,17 def search(nextcommand):
101 100 args.remove('dataOut')
102 101 except Exception as e:
103 102 pass
104 log.success('Showing arguments of {} are:\n\033[1m{}\033[0m'.format(nextcommand, '\n'.join(args)))
103 if len(args) == 0:
104 log.success('{} has no arguments'.format(nextcommand))
105 else:
106 log.success('Showing arguments of {} are:\n\033[1m{}\033[0m'.format(nextcommand, '\n'.join(args)))
105 107 except Exception as e:
106 108 log.error('Module {} does not exists'.format(nextcommand))
107 109 allModules = dir(import_module('schainpy.model'))
108 110 module = check_module(allModules, Operation)
109 111 module.extend(check_module(allModules, ProcessingUnit))
110 112 similar = process.extractOne(nextcommand, module)[0]
113 log.success('Searching {} instead'.format(similar))
111 114 search(similar)
112 115
113 116
General Comments 0
You need to be logged in to leave comments. Login now