예제 #1
0
    def deactivate(self, shell):
        self.info("Coherence UPnP plugin deactivated")
        if self.coherence is None:
            return

        self.coherence.shutdown()

        try:
            louie.disconnect(
                self.detected_media_server,
                'Coherence.UPnP.ControlPoint.MediaServer.detected', louie.Any)
        except louie.error.DispatcherKeyError:
            pass
        try:
            louie.disconnect(
                self.removed_media_server,
                'Coherence.UPnP.ControlPoint.MediaServer.removed', louie.Any)
        except louie.error.DispatcherKeyError:
            pass

        del self.shell
        del self.coherence

        for usn, source in self.sources.iteritems():
            source.delete_thyself()
        del self.sources
예제 #2
0
    def deactivate(self, shell):
        self.info("Coherence UPnP plugin deactivated")
        if self.coherence is None:
            return

        self.coherence.shutdown()

        try:
            louie.disconnect(self.detected_media_server,
                    'Coherence.UPnP.ControlPoint.MediaServer.detected',
                    louie.Any)
        except louie.error.DispatcherKeyError:
            pass
        try:
            louie.disconnect(self.removed_media_server,
                    'Coherence.UPnP.ControlPoint.MediaServer.removed',
                    louie.Any)
        except louie.error.DispatcherKeyError:
            pass

        del self.shell
        del self.coherence

        for usn, source in self.sources.iteritems():
            source.delete_thyself()
        del self.sources
예제 #3
0
 def shutdown(self):
     louie.disconnect(self._device_detected, "Coherence.UPnP.Device.detection_completed", louie.Any)
     louie.disconnect(self._device_removed, "Coherence.UPnP.Device.removed", louie.Any)
     for _device_id, device in self.devices.iteritems():
         device.shutdown()
     self.devices = {}
     self.remove_from_connection()
     self.bus = None
예제 #4
0
 def _release_thyself(self, suicide_mode=True):
     louie.disconnect(self.variable_changed, "StateVariable.changed", sender=self.service)
     self.service = None
     self.dbus_device = None
     self.remove_from_connection()
     self.path = None
     if suicide_mode:
         del self
예제 #5
0
 def disconnect(self,
                receiver,
                signal=louie.signal.All,
                sender=louie.sender.Any,
                weak=True):
     """ wrapper method around louie.disconnect
     """
     louie.disconnect(receiver, signal=signal, sender=sender, weak=weak)
예제 #6
0
 def _release_thyself(self):
     louie.disconnect(self.variable_changed, 'StateVariable.changed', sender=self.service)
     self.service = None
     self.dbus_device = None
     self.tube = None
     self.path = None
     self.remove_from_connection()
     del self
예제 #7
0
 def _release_thyself(self, suicide_mode=True):
     louie.disconnect(self.variable_changed,
                      'StateVariable.changed',
                      sender=self.service)
     self.service = None
     self.dbus_device = None
     self.remove_from_connection()
     self.path = None
     if suicide_mode:
         del self
예제 #8
0
 def shutdown(self):
     louie.disconnect(self._device_detected,
                      'Coherence.UPnP.Device.detection_completed',
                      louie.Any)
     louie.disconnect(self._device_removed, 'Coherence.UPnP.Device.removed',
                      louie.Any)
     for device_id, device in self.devices.iteritems():
         device.shutdown()
     self.devices = {}
     self.remove_from_connection()
     self.bus = None
예제 #9
0
    def deactivate(self, shell):
        print "coherence UPnP plugin deactivated"
        if self.coherence is None:
            return

        self.coherence.shutdown()

        louie.disconnect(self.detected_media_server,
                'Coherence.UPnP.ControlPoint.MediaServer.detected',
                louie.Any)
        louie.disconnect(self.removed_media_server,
                'Coherence.UPnP.ControlPoint.MediaServer.removed',
                louie.Any)

        del self.shell
        del self.coherence

        for usn, source in self.sources.iteritems():
            source.delete_thyself()
        del self.sources
예제 #10
0
 def shutdown(self):
     louie.disconnect(self.check_device,
                      'Coherence.UPnP.Device.detection_completed',
                      louie.Any)
     louie.disconnect(self.remove_client,
                      'Coherence.UPnP.Device.remove_client', louie.Any)
     louie.disconnect(self.completed,
                      'Coherence.UPnP.DeviceClient.detection_completed',
                      louie.Any)
예제 #11
0
파일: base.py 프로젝트: Python3pkg/Cohen
 def homecleanup(result):
   """anything left over"""
   louie.disconnect(self.create_device, 'Coherence.UPnP.SSDP.new_device', louie.Any)
   louie.disconnect(self.remove_device, 'Coherence.UPnP.SSDP.removed_device', louie.Any)
   louie.disconnect(self.add_device, 'Coherence.UPnP.RootDevice.detection_completed', louie.Any)
   self.ssdp_server.shutdown()
   if self.ctrl:
     self.ctrl.shutdown()
   self.warning('Coherence UPnP framework shutdown')
   return result
예제 #12
0
 def shutdown(self):
     louie.disconnect(self.check_device, 'Coherence.UPnP.Device.detection_completed', louie.Any)
     louie.disconnect(self.remove_client, 'Coherence.UPnP.Device.remove_client', louie.Any)
     louie.disconnect(self.completed, 'Coherence.UPnP.DeviceClient.detection_completed', louie.Any)
예제 #13
0
 def disconnect(self, receiver, signal=louie.signal.All, sender=louie.sender.Any, weak=True):
     """ wrapper method around louie.disconnect
     """
     louie.disconnect(receiver, signal=signal, sender=sender, weak=weak)
예제 #14
0
 def stop(self, despatch):
     louie.disconnect(self.new_server, 'Coherence.UPnP.ControlPoint.MediaServer.detected', louie.Any)
     louie.disconnect(self.new_renderer, 'Coherence.UPnP.ControlPoint.MediaRenderer.detected', louie.Any)
     louie.disconnect(self.remove_server, 'Coherence.UPnP.ControlPoint.MediaServer.removed', louie.Any)
     louie.disconnect(self.remove_renderer, 'Coherence.UPnP.ControlPoint.MediaRenderer.removed', louie.Any)
예제 #15
0
		def receive_callback(device):
			if device == self.device:
				louie.disconnect(receive_callback, 'Coherence.UPnP.RootDevice.detection_completed')
				d.callback(device)
예제 #16
0
파일: utils.py 프로젝트: furbrain/tingplay
def disconnect_variable(service, var_name, callback):
    signal = 'Coherence.UPnP.StateVariable.%s.changed' % var_name
    louie.disconnect(service, signal, callback)