예제 #1
0
	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
예제 #2
0
	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)
예제 #3
0
	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)
예제 #4
0
	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)
예제 #5
0
	def __init__(self, obj):
		MP_object.__init__(self, obj, self.get_attr);
예제 #6
0
	def __init__(self, dbus_obj, pawrapper, get_attr):
		MP_object.__init__(self, dbus_obj, get_attr);
		self._props = None
		self._pawrapper = pawrapper
예제 #7
0
	def __init__(self, cmd, device):
		MP_object.__init__(self, None, None);
		self.cmd = cmd[0]
		self.time = cmd[1]
		self.device = device