File: //usr/lib/python3/dist-packages/twisted/names/__pycache__/authority.cpython-38.pyc
U
W[�@ � @ 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 5 Q R X W 5 t�|� X t| d��}|�� � � \}}W 5 Q R X ||kr�t
|�d p�d}t| d��}|�d||f � W 5 Q R X |d |f }|S )
ay
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.
@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 0�r� r z%s %dz%02d)�time�strftime�os�umask�path�exists�open�write�readline�split�int)�filename�serial�o�fZ
serialFileZ
lastSerialZzoneID� r! �9/usr/lib/python3/dist-packages/twisted/names/authority.py� getSerial s
r# c @ sh e Zd ZdZejejejfZej ej
fZdZdZ
dd� Zdd� Zdd� Zdd d
�Zddd
�Zdd� ZdS )�
FileAuthoritya�
An Authority that is loaded from a file.
@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}.
Nc C s t j�| � | �|� i | _d S �N)r �ResolverBase�__init__�loadFile�_cache)�selfr r! r! r"