Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/names/__pycache__/authority.cpython-39.pyc
Ðазад
a k�h+A � @ s� d Z ddlZddlZddlmZ ddlmZmZmZ ddl m Z ddlmZm Z ddlmZ dd d �ZG dd� dej�ZG d d� de�ZG dd� de�ZdS )z Authoritative resolvers. � N)�defer)�common�dns�error)�failure)�execfile�nativeString)�FilePath�/tmp/twisted-names.serialc C s t �d�}t�d�}zRtj�| �sZt| d��}|�|d � W d � n1 sP0 Y W t�|� nt�|� 0 t| �� }|�� � � \}}W d � n1 s�0 Y ||kr�t |�d p�d}t| d��"}|�d||f � W d � n1 s�0 Y |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 z%s %dz%02d)�time�strftime�os�umask�path�exists�open�write�readline�split�int)�filename�serial�o�fZ serialFileZ lastSerialZzoneID� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/names/authority.py� getSerial s . .0r 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{bytes} keys Nc C s t j�| � | �|� i | _d S �N)r �ResolverBase�__init__�loadFile�_cache��selfr r r r r# V s zFileAuthority.__init__c C s || _ d S r! )�__dict__)r'