Python twisted.internet.reactor.removeAll() Examples

The following are 6 code examples of twisted.internet.reactor.removeAll(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module twisted.internet.reactor , or try the search function .
Example #1
Source File: util.py    From Safejumper-for-Desktop with GNU General Public License v2.0 5 votes vote down vote up
def _cleanReactor(self):
        """
        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        """
        reactor = self._getReactor()
        selectableStrings = []
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess('KILL')
            selectableStrings.append(repr(sel))
        return selectableStrings 
Example #2
Source File: test_logging.py    From autopush with Mozilla Public License 2.0 5 votes vote down vote up
def tearDown(self):
        os.environ.pop("SENTRY_DSN", None)
        reactor.removeAll() 
Example #3
Source File: util.py    From learn_python3_spider with MIT License 5 votes vote down vote up
def _cleanReactor(self):
        """
        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        """
        reactor = self._getReactor()
        selectableStrings = []
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess('KILL')
            selectableStrings.append(repr(sel))
        return selectableStrings 
Example #4
Source File: util.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
def _cleanReactor(self):
        """
        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        """
        reactor = self._getReactor()
        selectableStrings = []
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess('KILL')
            selectableStrings.append(repr(sel))
        return selectableStrings 
Example #5
Source File: util.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def do_cleanReactor(cls):
        s = []
        from twisted.internet import reactor
        removedSelectables = reactor.removeAll()
        if removedSelectables:
            s.append(DIRTY_REACTOR_MSG)
            for sel in removedSelectables:
                if interfaces.IProcessTransport.providedBy(sel):
                    sel.signalProcess('KILL')
                s.append(repr(sel))
        if s:
            raise DirtyReactorError(' '.join(s)) 
Example #6
Source File: runtest.py    From maas with GNU Affero General Public License v3.0 5 votes vote down vote up
def _cleanSelectables(self):
        """Remove all selectables and return their string representation.

        Kill any of them that were processes.
        """
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess("KILL")
            yield sel