/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor
Edit: /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyc (3115B)
Ńň
H<Vc @ sj d Z d d k Z d d k Z y d d k Z Wn e j
o d d k Z n Xd e f d YZ d S( s Manage the forwarder process.i˙˙˙˙Nt Forwarderc B sA e Z d Z d d Z d Z e d Z d Z d Z RS( s' Forwards digest to remote pyzor serversi' c C s: t i d | _ | | _ t i | | _ | | _ d S( s
forward_client: a pyzor.client.Client instance to use as
forwarding client
remote_servers: a list of (hostname,port) tuples where digests should
be forwarded to
max_queue_size: max amount of queued digests
t pyzordN( t loggingt getLoggert logt forwarding_clientt Queuet
forward_queuet remote_servers( t selfR R t max_queue_size( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt __init__ s c
C să xÜ t oÔ y% | i i d t d d \ } } Wn. t i j
o | i d j o d Sq n Xxw | i D]l } y5 | o | i i | | n | i i | | Wqj t
j
o" } | i i d | | | qj Xqj Wq Wd S( s' read forwarding requests from the queuet blockt timeouti Ns% Forwarding digest %s to %s failed: %s(
t TrueR t getR t EmptyR t NoneR t whitelistt reportt ExceptionR t warn( R t digestR t servert ex( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt
_forward_loop s$
c C sL | i d j o d Sy | i i | | f Wn t i j
o n Xd S( sĐ If forwarding is enabled, insert a digest into the forwarding queue
if whitelist is True, the digest will be forwarded as whitelist request
if the queue is full, the digest is dropped
N( R R R t
put_nowaitR t Full( R R R ( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt queue_forward_request5 s c C s t i d | i i d S( s start the forwarding threadt targetN( t threadingt ThreadR t start( R ( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt start_forwardingB s c C s
d | _ d S( s? disable forwarding and tell the forwarding thread to end itselfN( R R ( R ( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt stop_forwardingF s ( t __name__t
__module__t __doc__R R t FalseR R! R" ( ( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyR s
( R% R R R t ImportErrort queuet objectR ( ( ( sI /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/forwarder.pyt
s