Esempio n. 1
0
 def __init__(self, reactor, port):
     Observable.__init__(self)
     ear = socket()
     err = ear.getsockopt(SOL_SOCKET, SO_ERROR)
     if err != 0:  # connection created succesfully?
         raise IOError(err)
     ear.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
     ear.setsockopt(SOL_SOCKET, SO_LINGER, pack("ii", 0, 0))
     ear.bind(("0.0.0.0", port))
     ear.listen(127)
     reactor.addReader(ear, self.connect)
     self._ear = ear
     self._reactor = reactor
Esempio n. 2
0
 def __init__(self, reactor, port):
     Observable.__init__(self)
     ear = socket()
     err = ear.getsockopt(SOL_SOCKET, SO_ERROR)
     if err != 0:    # connection created succesfully?
         raise IOError(err)
     ear.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
     ear.setsockopt(SOL_SOCKET, SO_LINGER, pack('ii', 0, 0))
     ear.bind(('0.0.0.0', port))
     ear.listen(127)
     reactor.addReader(ear, self.connect)
     self._ear = ear
     self._reactor = reactor
Esempio n. 3
0
    def __init__(self, reactor, unusedTimeout=None, limits=None, **kwargs):
        Observable.__init__(self, **kwargs)
        self._reactor = reactor
        self._unusedTimeout = unusedTimeout
        self._limitTotalSize = limits.get(_TOTAL_SIZE) if limits else None
        self._limitDestinationSize = limits.get(_DESTINATION_SIZE) if limits else None
        self._pool = {}
        self._poolSize = 0

        if limits and not set(limits.keys()).issubset(_LIMITS):
            raise TypeError('limits argument options must be one of: ' + ', '.join(_LIMITS))

        if unusedTimeout is not None:
            self._initUnusedTimeout()
Esempio n. 4
0
    def __init__(self, reactor, unusedTimeout=None, limits=None, **kwargs):
        Observable.__init__(self, **kwargs)
        self._reactor = reactor
        self._unusedTimeout = unusedTimeout
        self._limitTotalSize = limits.get(_TOTAL_SIZE) if limits else None
        self._limitDestinationSize = limits.get(
            _DESTINATION_SIZE) if limits else None
        self._pool = {}
        self._poolSize = 0

        if limits and not set(limits.keys()).issubset(_LIMITS):
            raise TypeError('limits argument options must be one of: ' +
                            ', '.join(_LIMITS))

        if unusedTimeout is not None:
            self._initUnusedTimeout()
Esempio n. 5
0
 def __init__(self):
     Observable.__init__(self)
     self.generatorReturningCallable = partial(lambda arg:
                                               (x for x in 'a'),
                                               arg='partialed')
Esempio n. 6
0
 def __init__(self):
     Observable.__init__(self)
     self.generatorReturningCallable = partial(lambda arg: (x for x in 'a'), arg='partialed')
Esempio n. 7
0
 def __init__(self, name=None):
     Observable_orig.__init__(self, name=name)
     self.ctx = Context()
Esempio n. 8
0
 def __init__(self, name=None):
     Observable_orig.__init__(self, name=name)
     self.ctx = Context()
Esempio n. 9
0
 def __init__(self, unqualifiedTermFields, luceneSettings, ignoreStemmingForWords=None):
     Observable.__init__(self)
     self._unqualifiedTermFields = unqualifiedTermFields
     self._analyzer = luceneSettings.createAnalyzer()
     self._fieldRegistry = luceneSettings.fieldRegistry
     self._ignoreStemmingForWords = set(ignoreStemmingForWords or [])