File: //opt/alt/python37/lib/python3.7/site-packages/pydnsbl/__pycache__/checker.cpython-37.pyc
B
��f� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZmZm
Z
ejdkr�ejdkr�e�e�� � G dd� d�ZG d d
� d
�ZG dd� dej�ZG d
d� de�ZG dd� de�ZG dd� de�ZdS )z�
DNSBL async checker
Basic usage:
checker = DNSBLChecker()
result = cheker.check_ip('...')
print(result.blacklisted)
print(result.categories)
print(result.detected_by)
� N� )�Provider�BASE_PROVIDERS�BASE_DOMAIN_PROVIDERS�win32)� � c @ s* e Zd ZdZd dd�Zdd� Zdd� ZdS )
�DNSBLResultaA
DNSBL Result class to keep all info about ip request results.
Attributes:
* addr - checked ip
* providers - dnsbl that was asked for response while checking
* failed_provider - dnsbl that was unable to provide result due
to connection issues (connection timeout etc...)
* detected_by - dnsbl that have ip listed and categories detected by
this dnsbls. dict: {'dnsbl_list_name': list(categories_from_this_dnsbl)}
* categories - set of dnsbl categories from all providers (subset of DNSBL_CATEGORIES)
Nc C s8 || _ || _d| _g | _g | _i | _t� | _| �� d S )NF) �addr�_results�blacklisted� providers�failed_providers�detected_by�set�
categories�process_results)�selfr
�results� r �@/opt/alt/python37/lib/python3.7/site-packages/pydnsbl/checker.py�__init__( s zDNSBLResult.__init__c C sr xl| j D ]b}|j}| j�|� |jr2| j�|� q|js:qd| _|�|j�}| j �
|�| _ t|�| j|j
<