def getrepr(self): lst = {} lst.update(MP_object.getrepr(self)) if self._props: for k,v in self._props.items(): lst[k] = v[:-1] return lst
def __getattr__(self, attr): if attr == "name": return self.Name # check if attribute is in the property dictionary if self._props and attr in self._props: return self._props[attr][:-1] return MP_object.__getattr__(self, attr)
def __getattr__(self, attr): if attr == "name": return self.device["name"] if attr == "command": return "%x" % self.cmd[0] if attr == "values": return " ".join([ "%x" % c for c in self.cmd[1:]]) return MP_object.__getattr__(self, attr)
def __getattr__(self, attr): if attr == "name": return self._obj.sys_name if attr in self._obj.keys(): return self._obj[attr] if attr.upper() in self._obj.keys(): return self._obj[attr.upper()] if hasattr(self._obj, attr): return getattr(self._obj, attr) if attr in self._obj.attributes.keys(): return self._obj.attributes[attr] return MP_object.__getattr__(self, attr)
def __init__(self, obj): MP_object.__init__(self, obj, self.get_attr);
def __init__(self, dbus_obj, pawrapper, get_attr): MP_object.__init__(self, dbus_obj, get_attr); self._props = None self._pawrapper = pawrapper
def __init__(self, cmd, device): MP_object.__init__(self, None, None); self.cmd = cmd[0] self.time = cmd[1] self.device = device