Logo Search packages:      
Sourcecode: ubuntuone-dev-tools version File versions  Download package

def ubuntuone::devtools::testcase::DBusTestCase::cleanup_signal_receivers (   self,
  signal_receivers 
)
Cleanup self.signal_receivers and returns a deferred.

Definition at line 246 of file testcase.py.

                                                        :
        """Cleanup self.signal_receivers and returns a deferred."""
        # dbus modules will be imported by the decorator
        # pylint: disable=E0602
        deferreds = []
        for match in signal_receivers:
            d = defer.Deferred()

            def callback(*args):
                """Callback that accepts *args."""
                if not d.called:
                    d.callback(args)
            self.bus.call_async(dbus.bus.BUS_DAEMON_NAME,
                                dbus.bus.BUS_DAEMON_PATH,
                                dbus.bus.BUS_DAEMON_IFACE, 'RemoveMatch', 's',
                                (str(match),), callback, self.error_handler)
            deferreds.append(d)
        if deferreds:
            return defer.DeferredList(deferreds)
        else:
            return defer.succeed(True)

Generated by  Doxygen 1.6.0   Back to index