Your IP : 216.73.216.196
B
��d^�C � @ s� d Z ddlmZmZ ddlZddlZddlmZmZm Z ddl
mZ ddlm
Z
ddlmZmZmZ ddlmZ dd
d�ZG dd
� d
e j�ZG dd� de�ZG dd� de�ZdS )z
Authoritative resolvers.
� )�absolute_import�divisionN)�dns�error�common)�defer)�failure)�execfile�nativeString�_PY3)�FilePath�/tmp/twisted-names.serialc C s� t �d�}t�d�}z4tj�| �sFt| d��}|�|d � W dQ R X W dt�|� X t| d��}|�� � � \}}W dQ R X ||kr�t
|�d p�d}t| d��}|�d ||f � W dQ R X |d
|f }|S )a�
Return a monotonically increasing (across program runs) integer.
State is stored in the given file. If it does not exist, it is
created with rw-/---/--- permissions.
This manipulates process-global state by calling C{os.umask()}, so it isn't
thread-safe.
@param filename: Path to a file that is used to store the state across
program runs.
@type filename: L{str}
@return: a monotonically increasing number
@rtype: L{str}
z%Y%m%d� �wz 0N�r� r z%s %dz%02d)�time�strftime�os�umask�path�exists�open�write�readline�split�int)�filename�serial�o�fZ
serialFileZ
lastSerialZzoneID� r! �J/opt/alt/python37/lib64/python3.7/site-packages/twisted/names/authority.py� getSerial s
r# c @ sp e Zd ZdZejejejfZej ej
fZdZdZ
dd� Zdd� Zdd� Zd d
� Zddd�Zddd�Zdd� ZdS )�
FileAuthoritya�
An Authority that is loaded from a file.
This is an abstract class that implements record search logic. To create
a functional resolver, subclass it and override the L{loadFile} method.
@ivar _ADDITIONAL_PROCESSING_TYPES: Record types for which additional
processing will be done.
@ivar _ADDRESS_TYPES: Record types which are useful for inclusion in the
additional section generated during additional processing.
@ivar soa: A 2-tuple containing the SOA domain name as a L{bytes} and a
L{dns.Record_SOA}.
@ivar records: A mapping of domains (as lowercased L{bytes}) to records.
@type records: L{dict} with L{byte} keys
Nc C s t j�| � | �|� i | _d S )N)r �ResolverBase�__init__�loadFile�_cache)�selfr r! r! r"