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