/usr/lib/python3/dist-packages/twisted/names/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/names/__pycache__/secondary.cpython-310.pyc (7885B)
o
b @ s d dgZ ddlmZ ddlmZmZ ddlmZmZm Z m
Z
ddlmZ ddl
mZmZ ddlmZ G d d dejZG d
d d eZdS )SecondaryAuthoritySecondaryAuthorityService )service)defertask)clientcommondnsresolve)
FileAuthority)failurelog)nativeStringc @ sD e Zd ZdZdZdZdd Zedd Zdd Z d
d Z
dd
ZdS )r a:
A service that keeps one or more authorities up to date by doing hourly
zone transfers from a master.
@ivar primary: IP address of the master.
@type primary: L{str}
@ivar domains: An authority for each domain mirrored from the master.
@type domains: L{list} of L{SecondaryAuthority}
N5 c s" t | _ fdd|D | _dS )a
@param primary: The IP address of the server from which to perform
zone transfers.
@type primary: L{str}
@param domains: A sequence of domain names for which to perform
zone transfers.
@type domains: L{list} of L{bytes}
c s g | ]}t |qS )r .0dprimaryr 9/usr/lib/python3/dist-packages/twisted/names/secondary.py
+ s z6SecondaryAuthorityService.__init__..N)r r domains)selfr r r r r __init__ s
z"SecondaryAuthorityService.__init__c s0 \}}| |g }||_ fdd|D |_|S )a
Construct a new L{SecondaryAuthorityService} from a tuple giving a
server address and a C{str} giving the name of a domain for which this
is an authority.
@param serverAddress: A two-tuple, the first element of which is a
C{str} giving an IP address and the second element of which is a
C{int} giving a port number. Together, these define where zone
transfers will be attempted from.
@param domains: Domain names for which to perform zone transfers.
@type domains: sequence of L{bytes}
@return: A new instance of L{SecondaryAuthorityService}.
c s g | ]}t |qS r )r fromServerAddressAndDomainr
serverAddressr r r A s
zISecondaryAuthorityService.fromServerAddressAndDomains..)_portr )clsr r r portr r r r fromServerAddressAndDomains- s
z5SecondaryAuthorityService.fromServerAddressAndDomainsc C s t | jS )z_
Get a resolver for the transferred domains.
@rtype: L{ResolverChain}
)r
ResolverChainr r r r r getAuthorityG s z&SecondaryAuthorityService.getAuthorityc C sV t j| dd | jD | _d}ddlm} | jD ]}|||jd |d7 }qd S )Nc S s g | ]}t |jqS r )r LoopingCalltransferr r r r r Q s z:SecondaryAuthorityService.startService..r reactori ) r ServicestartServicer callstwisted.internetr( callLaterstart)r ir( cr r r r+ O s
z&SecondaryAuthorityService.startServicec C s$ t j| | jD ]}| q d S N)r r* stopServicer, stop)r r1 r r r r3 Z s
z%SecondaryAuthorityService.stopService)__name__
__module____qualname____doc__r, r r classmethodr! r$ r+ r3 r r r r r s
c @ sr e Zd ZdZdZd ZZdZdZdd Z e
dd Zd d
ZdddZ
d
d Zdd Zdd Zdd Zdd ZdS )r a
An Authority that keeps itself updated by performing zone transfers.
@ivar primary: The IP address of the server from which zone transfers will
be attempted.
@type primary: L{str}
@ivar _port: The port number of the server from which zone transfers will
be attempted.
@type _port: L{int}
@ivar domain: The domain for which this is the secondary authority.
@type domain: L{bytes}
@ivar _reactor: The reactor to use to perform the zone transfers, or
L{None} to use the global reactor.
FNr c C s&