fix simple command (e.g. stop)
This commit is contained in:
18
secop.py
18
secop.py
@ -150,17 +150,17 @@ class SecopInteractor(SecopClient):
|
||||
if module not in self.modules:
|
||||
return None
|
||||
logging.info('SENDCOMMAND %r', command)
|
||||
try:
|
||||
if is_param:
|
||||
if is_param:
|
||||
try:
|
||||
entry = self.setParameterFromString(module, parameter, strvalue)
|
||||
item = {'name': f'{module}:{parameter}', 'value': str(entry), 'formatted': entry.formatted()}
|
||||
self.updates[module, parameter] = item
|
||||
result = True
|
||||
else:
|
||||
result = self.execCommandFromString(module, parameter, strvalue)[0]
|
||||
except Exception as e:
|
||||
print(f"{e!r} converting {strvalue} to {self.modules[module]['parameters'][parameter]['datatype']}")
|
||||
return result
|
||||
except Exception as e:
|
||||
print(f"{e!r} converting {strvalue} to {self.modules[module]['parameters'][parameter]['datatype']}")
|
||||
self.updates[module, parameter] = item
|
||||
return True
|
||||
# called a command
|
||||
result = self.execCommandFromString(module, parameter, strvalue)
|
||||
return {'name': f'{module}:{parameter}', 'value': str(result), 'formatted': result.formatted()}
|
||||
|
||||
def get_updates(self):
|
||||
updates, self.updates = self.updates, {}
|
||||
|
Reference in New Issue
Block a user