Beispiel #1
0
 def __init__ (self, bus, path, device, IsExtra=False):
   # print self.__class__.Version
   self.item = device
   self.path = path
   GPropSync.__init__(self, bus, path)
   if device.fields:
     self.set_property('name', device.name)
     """
     for key in device.fields:
       self.set_property(key, device.fields[key])
     """
   self.name = device.name
   for field in self.item.required:
     self.PROP_SIGS[field] = self.PROP_SIGS.get(field, 's')
   fields = self.item.fields
   if self.isExtra:
     # print "EXTRA", self.path
     # print self.item.extra.fields
     fields = self.item.extra.fields
   for x in fields.keys( ):
     self.PROP_SIGS[x] = self.PROP_SIGS.get(x, 's')
   self.PropertiesChanged(self.OWN_IFACE, fields, [])
   if hasattr(self.item, 'extra') and not IsExtra:
     extra_path = self.path + 'Extra'
     self.extra_config = ExtraConfig(bus, extra_path, self.item, IsExtra=True)
Beispiel #2
0
 def __init__ (self, bus, path, device, IsExtra=False):
   # print self.__class__.Version
   self.item = device
   self.path = path
   GPropSync.__init__(self, bus, path)
   if device.fields:
     self.set_property('name', device.name)
     """
     for key in device.fields:
       self.set_property(key, device.fields[key])
     """
   self.name = device.name
   for field in self.item.required:
     self.PROP_SIGS[field] = self.PROP_SIGS.get(field, 's')
   fields = self.item.fields
   if self.isExtra:
     # print "EXTRA", self.path
     # print self.item.extra.fields
     fields = self.item.extra.fields
   for x in fields.keys( ):
     self.PROP_SIGS[x] = self.PROP_SIGS.get(x, 's')
   self.PropertiesChanged(self.OWN_IFACE, fields, [])
   if hasattr(self.item, 'extra') and not IsExtra:
     extra_path = self.path + 'Extra'
     self.extra_config = ExtraConfig(bus, extra_path, self.item, IsExtra=True)
Beispiel #3
0
 def __init__ (self, bus, ctrl):
   self.bus = bus
   self.path = PATH + '/Heartbeat'
   self.master = ctrl
   self.started_at = time.time( )
   self.now = datetime.fromtimestamp(self.started_at)
   GPropSync.__init__(self, bus, self.path)
   self.handle = None
   self.Start( )
Beispiel #4
0
 def __init__(self, bus, ctrl):
     self.bus = bus
     self.path = PATH + '/Heartbeat'
     self.master = ctrl
     self.started_at = time.time()
     self.now = datetime.fromtimestamp(self.started_at)
     GPropSync.__init__(self, bus, self.path)
     self.handle = None
     self.Start()
Beispiel #5
0
 def __init__ (self, path, manager=None, props=None):
   self.manager = manager
   bus = manager.bus
   self.bus = bus or dbus.SessionBus( )
   self.path = path
   # self.when = armed.when
   # self.armed = armed
   GPropSync.__init__(self, self.bus.get_connection( ), path)
   # WithProperties.__init__(self, self.bus.get_connection( ), path)
   self.attrs = props
Beispiel #6
0
 def __init__ (self, path, manager=None, props=None, armed=None):
   self.manager = manager
   bus = manager.bus
   self.bus = bus or dbus.SessionBus( )
   self.path = path
   self.when = armed.when
   self.armed = armed
   self._status = 0
   GPropSync.__init__(self, self.bus.get_connection( ), path)
   # WithProperties.__init__(self, self.bus.get_connection( ), path)
   self.attrs = props
   self.attrs['trigger'] = self.armed.hashed
   if props:
     for key in props:
       self.set_property(key, props[key])
   self.sync_all_props( )
Beispiel #7
0
 def __init__ (self, path, manager=None, props=None, armed=None):
   self.manager = manager
   bus = manager.bus
   self.bus = bus or dbus.SessionBus( )
   self.path = path
   self.when = armed.when
   self.armed = armed
   self._status = 0
   GPropSync.__init__(self, self.bus.get_connection( ), path)
   # WithProperties.__init__(self, self.bus.get_connection( ), path)
   self.attrs = props
   self.attrs['trigger'] = self.armed.hashed
   if props:
     for key in props:
       self.set_property(key, props[key])
   self.sync_all_props( )