/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/client.pyc (13822B)
Ñò
H<Vc
@ s d Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k
Z d d k Z e i i
i ƒ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d
„ ƒ YZ d e f d „ ƒ YZ d S(
sq Networked spam-signature detection client.
>>> import pyzor
>>> import pyzor.client
>>> import pyzor.digest
>>> import pyzor.config
To load the accounts file:
>>> accounts = pyzor.config.load_accounts(filename)
To create a client (to then issue commands):
>>> client = pyzor.client.Client(accounts)
To create a client, using the anonymous user:
>>> client = pyzor.client.Client()
To get a digest (of an email.message.Message object, or similar):
>>> digest = pyzor.digest.get_digest(msg)
To query a server (where address is a (host, port) pair):
>>> client.ping(address)
>>> client.info(digest, address)
>>> client.report(digest, address)
>>> client.whitelist(digest, address)
>>> client.check(digest, address)
To query the default server (public.pyzor.org):
>>> client.ping()
>>> client.info(digest)
>>> client.report(digest)
>>> client.whitelist(digest)
>>> client.check(digest)
Response will contain, depending on the type of request, some
of the following keys (e.g. client.ping()['Code']):
All responses will have:
- 'Diag' 'OK' or error message
- 'Code' '200' if OK
- 'PV' Protocol Version
- 'Thread'
`info` and `check` responses will also contain:
- '[WL-]Count' Whitelist/Blacklist count
`info` responses will also have:
- '[WL-]Entered' timestamp when message was first whitelisted/blacklisted
- '[WL-]Updated' timestamp when message was last whitelisted/blacklisted
iÿÿÿÿNt Clientc B sž e Z d Z d Z d d d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z
d d
„ Z d d „ Z d d „ Z
e d
„ ƒ Z d „ Z RS( i i c C sŒ | d j o
h } n t d „ | i ƒ Dƒ ƒ | _ | d j o t i i } n | | _ | d j o
| | _ n t i
d ƒ | _ d S( Nc s s7 x0 | ]) \ \ } } } | t | ƒ f | f Vq Wd S( N( t int( t .0t hostt portt account( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pys
P s t pyzor( t Nonet dictt iteritemst accountsR t digestt digest_spect spect timeoutt loggingt getLoggert log( t selfR
R R
( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt __init__M s
s public.pyzor.orgiy_ c C s7 t i i ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R t messaget PingRequestt sendt
read_responset
get_thread( R t addresst msgt sock( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt pingY s c C s: t i i | ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R R t PongRequestR R R ( R R R R R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt pong^ s c C s: t i i | ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R R t InfoRequestR R R ( R R R R R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt infoc s c C s@ t i i | | i ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R R t
ReportRequestR
R R R ( R R R R R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt reporth s c C s@ t i i | | i ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R R t WhitelistRequestR
R R R ( R R R R R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt whitelistm s c C s: t i i | ƒ } | i | | ƒ } | i | | i ƒ ƒ S( N( R R t CheckRequestR R R ( R R R R R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt checkr s c C s5 d t i i i t i f } t i | d t i i ƒS( Ns: Code: %s
Diag: OK
PV: %s
Thread: 1024
Count: 0
WL-Count: 0t _class( R R t Responset ok_codet
proto_versiont emailt message_from_bytes( R t digestsR R ( ( sF /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/client.pyt _mock_checkw s
c C sà | d t | d ƒ f } | i ƒ y | i | } Wn t j
o t i i } n Xt t i ƒ ƒ } | i | d