%PDF- %PDF-
Direktori : /lib/python3.6/site-packages/pyzor/__pycache__/ |
Current File : //lib/python3.6/site-packages/pyzor/__pycache__/client.cpython-36.pyc |
3 �2�^J* � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl ZddlZejj j� G dd� de�ZG dd� de�ZG dd� de�ZG d d � d e�ZG dd� de�ZdS ) ay 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.DataDigester(msg).value 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 � Nc @ s� e Zd ZdZdZddd�Zddd �Zd d d�Zd"dd �Zd$dd�Z d&dd�Z d(dd�Zd)dd�Zd+dd�Z edd� �Zdd� ZdS ),�Client� i Nc C sX |d kri }t dd� |j� D ��| _|d kr4tjj}|| _|d k rH|| _tj d�| _ d S )Nc s s&