@@ -46,7 +46,7 def getOperations(): | |||
|
46 | 46 | def getArgs(op): |
|
47 | 47 | module = locate('schainpy.model.{}'.format(op)) |
|
48 | 48 | |
|
49 | if hasattr(module, '__attrs'): | |
|
49 | if hasattr(module, '__attrs__'): | |
|
50 | 50 | args = module.__attrs__ |
|
51 | 51 | else: |
|
52 | 52 | args = inspect.getargspec(module.run).args |
@@ -148,7 +148,8 def search(nextcommand): | |||
|
148 | 148 | if nextcommand is None: |
|
149 | 149 | log.error('There is no Operation/ProcessingUnit to search', '') |
|
150 | 150 | else: |
|
151 | try: | |
|
151 | #try: | |
|
152 | if True: | |
|
152 | 153 | args = getArgs(nextcommand) |
|
153 | 154 | doc = getDoc(nextcommand) |
|
154 | 155 | if len(args) == 0: |
@@ -156,11 +157,11 def search(nextcommand): | |||
|
156 | 157 | else: |
|
157 | 158 | log.success('{}\n{}\n\narguments:\n {}'.format( |
|
158 | 159 | nextcommand, doc, ', '.join(args)), '') |
|
159 | except Exception as e: | |
|
160 | log.error('Module `{}` does not exists'.format(nextcommand), '') | |
|
161 | allModules = getAll() | |
|
162 | similar = [t[0] for t in process.extract(nextcommand, allModules, limit=12) if t[1]>80] | |
|
163 | log.success('Possible modules are: {}'.format(', '.join(similar)), '') | |
|
160 | # except Exception as e: | |
|
161 | # log.error('Module `{}` does not exists'.format(nextcommand), '') | |
|
162 | # allModules = getAll() | |
|
163 | # similar = [t[0] for t in process.extract(nextcommand, allModules, limit=12) if t[1]>80] | |
|
164 | # log.success('Possible modules are: {}'.format(', '.join(similar)), '') | |
|
164 | 165 | |
|
165 | 166 | def runschain(nextcommand): |
|
166 | 167 | if nextcommand is None: |
General Comments 0
You need to be logged in to leave comments.
Login now