def _command(device, cmd_info, *args, **kwargs): name = cmd_info.cmd_name if cmd_info.in_type == CmdArgType.DevEncoded: result = device.command_inout(name, dumps((args, kwargs))) else: result = device.command_inout(name, *args, **kwargs) if cmd_info.out_type == CmdArgType.DevEncoded: result = loads(*result) return result
def get(self, name): dev = self.device result = self.get_attr_info(name) if result: result = dev.read_attribute(name) value = result.value if result.type == PyTango.DevEncoded: result = loads(*value) else: result = value return result result = self.get_cmd_info(name) if result is None: raise KeyError("Unknown %s" % name) return result