CasperSecurity

Current Path : /lib/python3/dist-packages/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/__pycache__/distro_info.cpython-310.pyc

o

.�ee�0�@s�dZddlZddlZddlZdd�Zdd�ZGdd�de�ZGd	d
�d
�Zdd�Z	Gd
d�d�Z
Gdd�de
�ZGdd�de
�ZdS)z>provides information about Ubuntu's and Debian's distributions�NcCs�|sd}|Sdd�|�d�D�}t|�dkr$|\}}}t�|||�}|St|�dkrK|\}}|dkr;t�||d�}|St�||d	d	�t�d	�}|Std
��)z9Convert a date string in ISO 8601 into a datetime object.NcSsg|]}t|��qS�)�int��.0�xrr�-/usr/lib/python3/dist-packages/distro_info.py�
<listcomp>sz convert_date.<locals>.<listcomp>�-�����zDate not in ISO 8601 format.)�split�len�datetime�date�	timedelta�
ValueError)�stringr�parts�year�month�dayrrr�convert_dates �
	���rcCsdS)z4Get the data directory based on the module location.z/usr/share/distro-inforrrrr�
_get_data_dir*srcs eZdZdZ�fdd�Z�ZS)�DistroDataOutdatedzDistribution data outdated.c�t��d�dS)Nz�Distribution data outdated. Please check for an update for distro-info-data. See /usr/share/doc/distro-info-data/README.Debian for details.��super�__init__��self��	__class__rrr 2s�zDistroDataOutdated.__init__)�__name__�
__module__�__qualname__�__doc__r �
__classcell__rrr#rr/src@s0eZdZdZ							ddd�Zdd�ZdS)�
DistroReleasez"Represents a distributions releaseNcCs@||_||_||_||_||_||_||_|	|_||_|
|_	dS�N)
�version�codename�series�created�release�eol�eol_lts�eol_elts�eol_esm�
eol_server)r"r,r-r.r/r0r1r4r2r3r5rrrr ?s
zDistroRelease.__init__cCs2||jko|jdup||jkp|jduo||jkS)z:Check whether this release is supported on the given date.N)r/r1r5�r"rrrr�is_supportedXs

��zDistroRelease.is_supported)NNNNNNN)r%r&r'r(r r7rrrrr*9s

�r*cCs||vr
t||�SdSr+)r)�row�columnrrr�	_get_dateasr:c@s�eZdZdZdd�Zedd��Zddd�Zd	d
�Zddd
�Z	ddd�Z
ddd�Zdd�Zddd�Z
ddd�Zdd�Zddd�ZdS) �
DistroInfozzBase class for distribution information.
    Use DebianDistroInfo or UbuntuDistroInfo instead of using this directly.
    cCs�||_tj�t�|��d�}t|dd��C}t�|�}g|_	|D]0}t
|d|d|dt|d�t|d�t|d	�t|d
�t|d�t|d�t|d
��
}|j	�|�q Wd�n1s[wYt
j��|_dS)Nz.csvzutf-8)�encodingr,r-r.r/r0r1zeol-esmzeol-ltszeol-eltsz
eol-server)�_distro�os�path�joinr�lower�open�csv�
DictReader�	_releasesr*r:�appendrr�today�_date)r"�distro�filename�csvfile�
csv_readerr8r0rrrr js,
���zDistroInfo.__init__cCsdd�|jD�S)z*List codenames of all known distributions.cSsg|]}|j�qSr�r.rrrrr�sz"DistroInfo.all.<locals>.<listcomp>�rEr!rrr�all�szDistroInfo.allr-cs��fdd��jD�S)zList all known distributions.csg|]}���|��qSr)�_formatr��resultr"rrr�sz&DistroInfo.get_all.<locals>.<listcomp>rN)r"rRrrQr�get_all�szDistroInfo.get_allcs�fdd�|jD�S)z?Return all distributions that were available on the given date.csg|]	}�|jkr|�qSr)r/r�rrrr��z%DistroInfo._avail.<locals>.<listcomp>rNr6rrTr�_avail��zDistroInfo._availNcCs|S)z3Map codename aliases to the codename they describe.r)r"r0r�defaultrrrr-�szDistroInfo.codenamecCs*|jD]}||j|jfvr|jSq|S)z!Map codename or series to version)rEr-r.r,)r"�namerXr0rrrr,�s


�zDistroInfo.versionc�@�dur|j��fdd�|���D�}|st��|�||d�S)�<Get latest development distribution based on the given date.Nc�8g|]}|jdus�|jkr|jdus�|jkr|�qSr+�r0r1rrTrrr��
(�z$DistroInfo.devel.<locals>.<listcomp>����rHrVrrP�r"rrR�distrosrrTr�devel��
�zDistroInfo.develcCs^|dkr|S|dkr
|jS|dkr |jd|jd|jdS|dkr'|jStd|d	��)
z"Format a given distribution entry.�objectr-�fullname� z "�"r0zQOnly codename, fullname, object, and release are allowed result values, but not 'z'.)r.r=r,r-r)r"�
format_stringr0rrrrP�s���zDistroInfo._formatcrZ)z7Get latest stable distribution based on the given date.Ncs8g|]}|jdur�|jkr|jdus�|jkr|�qSr+r]rrTrrr�r^z%DistroInfo.stable.<locals>.<listcomp>r_r`rarrTr�stable�rdzDistroInfo.stablecCst��)z@Get list of all supported distributions based on the given date.)�NotImplementedError)r"rrRrrr�	supported�szDistroInfo.supportedcCs
||jvS)�%Check if the given codename is known.)rO�r"r-rrr�valid�s
zDistroInfo.validcs8|dur�j}��|�����fdd���|�D�}|S)zBGet list of all unsupported distributions based on the given date.Ncs"g|]
}|j�vr���|��qSr)r.rPr�rRr"rlrrr�s"z*DistroInfo.unsupported.<locals>.<listcomp>)rHrlrVrarrpr�unsupported�s

zDistroInfo.unsupported�r-�NNr+�Nr-)r%r&r'r(r �propertyrOrSrVr-r,rcrPrjrlrorqrrrrr;es







r;csneZdZdZ�fdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�Zdd�Z�Z
S)�DebianDistroInfoz1provides information about Debian's distributionscr)N�Debianrr!r#rrr ��zDebianDistroInfo.__init__NcCs`|dkr|�|�}|S|dkr|�|�}|S|dkr!|�|�}|S|dkr,|�|�}|S|}|S)z3Map 'unstable', 'testing', etc. to their codenames.�unstable�testingrj�	oldstable)rcrzrj�old)r"r0rrXr-rrrr-�s
	�
�
�
�zDebianDistroInfo.codenamer-c�H�dur|j��fdd�|���D�}t|�dkrt��|�||d�S)r[Ncr\r+r]rrTrrr�r^z*DebianDistroInfo.devel.<locals>.<listcomp>r����rHrVrrrPrarrTrrc�s
�zDebianDistroInfo.develcr})z=Get old (stable) Debian distribution based on the given date.Ncs$g|]}|jdur�|jkr|�qSr+)r0rrTrrr�s$z(DebianDistroInfo.old.<locals>.<listcomp>rr~rrarrTrr|�szDebianDistroInfo.oldc�.�dur�j����fdd�����D�}|S)zOGet list of all supported Debian distributions based on the given
        date.Ncs,g|]}|jdus�|jkr���|��qSr+)r1rPr�rrRr"rrrs&z.DebianDistroInfo.supported.<locals>.<listcomp>�rHrVrarr�rrl�s�zDebianDistroInfo.supportedcr�)zSGet list of all LTS supported Debian distributions based on the given
        date.Nc�@g|]}|jdur�|jkr|jdur�|jkr���|��qSr+)r1r2rPrr�rrr
�
�z2DebianDistroInfo.lts_supported.<locals>.<listcomp>r�rarr�r�
lts_supported��zDebianDistroInfo.lts_supportedcr�)z\Get list of all Extended LTS supported Debian distributions based on
        the given date.Ncr�r+)r2r3rPrr�rrrr�z3DebianDistroInfo.elts_supported.<locals>.<listcomp>r�rarr�r�elts_supportedr�zDebianDistroInfo.elts_supportedcrZ)z?Get latest testing Debian distribution based on the given date.NcsHg|] }|jdur|js |jdur�|jkr|jdus �|jkr|�qSr+)r0r,r1rrTrrr&s(�z,DebianDistroInfo.testing.<locals>.<listcomp>r_r`rarrTrrz"s
�zDebianDistroInfo.testingcCst�||�p	|dvS)rm)ryrzrjr{)r;rornrrrro0rWzDebianDistroInfo.validrsrt)r%r&r'r(r r-rcr|rlr�r�rzror)rrr#rrv�s



	




rvcsFeZdZdZ�fdd�Zddd�Zdd	�Zdd
d�Zddd
�Z�Z	S)�UbuntuDistroInfoz1provides information about Ubuntu's distributionscr)N�Ubunturr!r#rrr =rxzUbuntuDistroInfo.__init__Nr-cs<�dur|j��fdd�|jD�}|st��|�||d�S)zWGet latest long term support (LTS) Ubuntu distribution based on the
        given date.Ncs<g|]}|j�d�dkr|j�kr|jkrnn|�qS)�LTSr)r,�findr0r1rrTrrrEs6z(UbuntuDistroInfo.lts.<locals>.<listcomp>r_)rHrErrPrarrTr�lts@s
�zUbuntuDistroInfo.ltscs*�fdd�|jD�}|sdSd|djvS)zIs codename an LTS release?csg|]	}|j�kr|�qSrrMrrrrrrNrUz+UbuntuDistroInfo.is_lts.<locals>.<listcomp>Fr�r)rEr,)r"r-rbrrrr�is_ltsLszUbuntuDistroInfo.is_ltscr�)zOGet list of all supported Ubuntu distributions based on the given
        date.Ncs6g|]}�|jks|jdur�|jkr���|��qSr+)r1r5rPrr�rrrXs

�z.UbuntuDistroInfo.supported.<locals>.<listcomp>r�rarr�rrlS��zUbuntuDistroInfo.supportedcr�)zSGet list of all ESM supported Ubuntu distributions based on the
        given date.Ncs,g|]}|jdur�|jkr���|��qSr+)r4rPrr�rrrds

�z2UbuntuDistroInfo.supported_esm.<locals>.<listcomp>r�rarr�r�
supported_esm_r�zUbuntuDistroInfo.supported_esmrt)
r%r&r'r(r r�r�rlr�r)rrr#rr�:s

r�)
r(rCrr>rr�	Exceptionrr*r:r;rvr�rrrr�<module>s
(of
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY