HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/__pycache__/distro_info.cpython-38.pyc
U

+�Gd�+�@s�dZddlZddlZddlZdd�Zdd�ZGdd�de�ZGd	d
�d
e�Z	dd�Z
Gd
d�de�ZGdd�de�ZGdd�de�Z
dS)z>provides information about Ubuntu's and Debian's distributions�NcCs�|s
d}n�dd�|�d�D�}t|�dkrD|\}}}t�|||�}nRt|�dkr�|\}}|dkrpt�||d�}q�t�||d	d	�t�d	�}ntd
��|S)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�dateZ	timedelta�
ValueError)�stringr�partsZyearZmonthZdayrrr�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.cstt|��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.)�superr�__init__��self��	__class__rrr2s
�zDistroDataOutdated.__init__)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrr/src@s"eZdZdZddd�Zdd�ZdS)�
DistroReleasez"Represents a distributions releaseNc		Cs4||_||_||_||_||_||_||_||_dS�N)�version�codename�series�created�release�eol�
eol_server�eol_esm)	rr&r'r(r)r*r+r,r-rrrr>szDistroRelease.__init__cCs2||jko0|jdkp0||jkp0|jdk	o0||jkS)z:Check whether this release is supported on the given date.N)r)r+r,�rrrrr�is_supportedJs�zDistroRelease.is_supported)NNNNN)rr r!r"rr/rrrrr$9s�
r$cCs||krt||�SdSr%)r)�row�columnrrr�	_get_datePsr2c@s�eZdZdZdd�Zedd��Zddd�Zd	d
�Zddd
�Z	ddd�Z
ddd�Zdd�Zd dd�Z
d!dd�Zdd�Zd"dd�ZdS)#�
DistroInfozzBase class for distribution information.
    Use DebianDistroInfo or UbuntuDistroInfo instead of using this directly.
    cCs�||_tj�t�|��d�}t|�}t�|�}g|_	|D]P}t
|d|d|dt|d�t|d�t|d�t|d�t|d	��}|j	�|�q:|�
�tj��|_dS)
Nz.csvr&r'r(r)r*r+z
eol-serverzeol-esm)�_distro�os�path�joinr�lower�open�csvZ
DictReader�	_releasesr$r2�append�closerrZtoday�_date)rZdistro�filenameZcsvfileZ
csv_readerr0r*rrrrYs 
�zDistroInfo.__init__cCsdd�|jD�S)z*List codenames of all known distributions.cSsg|]
}|j�qSr�r(rrrrrksz"DistroInfo.all.<locals>.<listcomp>�r;rrrr�allhszDistroInfo.allr'cs��fdd��jD�S)zList all known distributions.csg|]}���|��qSr)�_formatr��resultrrrrosz&DistroInfo.get_all.<locals>.<listcomp>rA)rrErrDr�get_allmszDistroInfo.get_allcs�fdd�|jD�S)z?Return all distributions that were available on the given date.csg|]}�|jkr|�qSr)r)r�rrrrss
z%DistroInfo._avail.<locals>.<listcomp>rAr.rrGr�_availqszDistroInfo._availNcCs|S)z3Map codename aliases to the codename they describe.r)rr*r�defaultrrrr'uszDistroInfo.codenamecCs*|jD]}||j|jfkr|jSq|S)z!Map codename or series to version)r;r'r(r&)r�namerIr*rrrr&zs
zDistroInfo.versioncs@�dkr|j��fdd�|���D�}|s0t��|�||d�S)�<Get latest development distribution based on the given date.Ncs8g|]0}|jdks0�|jkr|jdks0�|jkr|�qSr%�r*r+rrGrrr�s



�z$DistroInfo.devel.<locals>.<listcomp>����r>rHrrC�rrrE�distrosrrGr�devel�szDistroInfo.develcCsb|dkr|S|dkr|jS|dkr@|jd|jd|jdS|dkrN|jStd|d	��d
S)z"Format a given distribution entry.�objectr'�fullname� z "�"r*zQOnly codename, fullname, object, and release are allowed result values, but not 'z'.N)r(r4r&r'r)r�
format_stringr*rrrrC�s��zDistroInfo._formatcs@�dkr|j��fdd�|���D�}|s0t��|�||d�S)z7Get latest stable distribution based on the given date.Ncs8g|]0}|jdk	r�|jkr|jdks0�|jkr|�qSr%rLrrGrrr�s



�z%DistroInfo.stable.<locals>.<listcomp>rMrNrOrrGr�stable�szDistroInfo.stablecCs
t��dS)z@Get list of all supported distributions based on the given date.N)�NotImplementedError)rrrErrr�	supported�szDistroInfo.supportedcCs
||jkS)�%Check if the given codename is known.)rB�rr'rrr�valid�szDistroInfo.validcs8|dkr�j}��|�����fdd���|�D�}|S)zBGet list of all unsupported distributions based on the given date.Ncs"g|]}|j�kr���|��qSr)r(rCr�rErrYrrr�s
�z*DistroInfo.unsupported.<locals>.<listcomp>)r>rYrHrOrr]r�unsupported�s

zDistroInfo.unsupported)r')NN)N)Nr')Nr')NN)Nr')rr r!r"r�propertyrBrFrHr'r&rQrCrWrYr\r^rrrrr3Ts








r3csZeZdZdZ�fdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
�ZS)�DebianDistroInfoz1provides information about Debian's distributionscstt|��d�dS)NZDebian)rr`rrrrrr�szDebianDistroInfo.__init__NcCsX|dkr|�|�}n@|dkr(|�|�}n,|dkr<|�|�}n|dkrP|�|�}n|}|S)z3Map 'unstable', 'testing', etc. to their codenames.�unstable�testingrW�	oldstable)rQrbrW�old)rr*rrIr'rrrr'�szDebianDistroInfo.codenamer'csH�dkr|j��fdd�|���D�}t|�dkr8t��|�||d�S)rKNcs8g|]0}|jdks0�|jkr|jdks0�|jkr|�qSr%rLrrGrrr�s



�z*DebianDistroInfo.devel.<locals>.<listcomp>r����r>rHrrrCrOrrGrrQ�szDebianDistroInfo.develcsH�dkr|j��fdd�|���D�}t|�dkr8t��|�||d�S)z=Get old (stable) Debian distribution based on the given date.Ncs$g|]}|jdk	r�|jkr|�qSr%)r*rrGrrr�s

�z(DebianDistroInfo.old.<locals>.<listcomp>rrerfrOrrGrrd�szDebianDistroInfo.oldcs.�dkr�j����fdd�����D�}|S)zRGet list of all supported Debian distributions based on the given
           date.Ncs,g|]$}|jdks�|jkr���|��qSr%)r+rCr�rrErrrr�s

�z.DebianDistroInfo.supported.<locals>.<listcomp>�r>rHrOrrgrrY�szDebianDistroInfo.supportedcs@�dkr|j��fdd�|���D�}|s0t��|�||d�S)z?Get latest testing Debian distribution based on the given date.NcsHg|]@}|jdkr|js@|jdk	r�|jkr|jdks@�|jkr|�qSr%)r*r&r+rrGrrr�s




�z,DebianDistroInfo.testing.<locals>.<listcomp>rMrNrOrrGrrb�szDebianDistroInfo.testingcCst�||�p|dkS)rZ)rarbrWrc)r3r\r[rrrr\�s�zDebianDistroInfo.valid)NN)Nr')Nr')Nr')Nr')rr r!r"rr'rQrdrYrbr\r#rrrrr`�s





	
r`csFeZdZdZ�fdd�Zddd�Zdd	�Zdd
d�Zddd
�Z�Z	S)�UbuntuDistroInfoz1provides information about Ubuntu's distributionscstt|��d�dS)NZUbuntu)rrirrrrrr�szUbuntuDistroInfo.__init__Nr'cs<�dkr|j��fdd�|jD�}|s,t��|�||d�S)zZGet latest long term support (LTS) Ubuntu distribution based on the
           given date.Ncs<g|]4}|j�d�dkr|j�kr0|jkrnq|�qS)�LTSr)r&�findr*r+rrGrrrs
�z(UbuntuDistroInfo.lts.<locals>.<listcomp>rM)r>r;rrCrOrrGr�lts�szUbuntuDistroInfo.ltscs*�fdd�|jD�}|sdSd|djkS)zIs codename an LTS release?csg|]}|j�kr|�qSrr@r�r'rrr
s
z+UbuntuDistroInfo.is_lts.<locals>.<listcomp>Frjr)r;r&)rr'rPrrmr�is_ltsszUbuntuDistroInfo.is_ltscs.�dkr�j����fdd�����D�}|S)zRGet list of all supported Ubuntu distributions based on the given
           date.Ncs6g|].}�|jks&|jdk	r�|jkr���|��qSr%)r+r,rCrrgrrrs



�z.UbuntuDistroInfo.supported.<locals>.<listcomp>rhrOrrgrrYszUbuntuDistroInfo.supportedcs.�dkr�j����fdd�����D�}|S)zVGet list of all ESM supported Ubuntu distributions based on the
           given date.Ncs,g|]$}|jdk	r�|jkr���|��qSr%)r-rCrrgrrrs

�z2UbuntuDistroInfo.supported_esm.<locals>.<listcomp>rhrOrrgr�
supported_esmszUbuntuDistroInfo.supported_esm)Nr')Nr')Nr')
rr r!r"rrlrnrYror#rrrrri�s


ri)r"r:rr5rr�	ExceptionrrRr$r2r3r`rirrrr�<module>s
aB