HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/__pycache__/distro_info.cpython-39.pyc
a

�T>e�0�@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>�z 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.cst��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@s"eZdZdZddd�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 ?szDistroRelease.__init__cCs2||jko0|jdup0||jkp0|jduo0||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||vrt||�SdSr+)r)�row�columnrrr�	_get_dateasr:c@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.
    cCs�||_tj�t�|��d�}t|�}t�|�}g|_	|D]`}t
|d|d|dt|d�t|d�t|d�t|d�t|d	�t|d
�t|d��
}|j	�|�q:|�
�tj��|_dS)Nz.csvr,r-r.r/r0r1zeol-esmzeol-ltszeol-eltsz
eol-server)�_distro�os�path�joinr�lower�open�csvZ
DictReader�	_releasesr*r:�append�closerr�today�_date)r"Zdistro�filenameZcsvfileZ
csv_readerr8r0rrrr js*
�zDistroInfo.__init__cCsdd�|jD�S)z*List codenames of all known distributions.cSsg|]
}|j�qSr�r.rrrrr�r	z"DistroInfo.all.<locals>.<listcomp>�rCr!rrr�all�szDistroInfo.allr-cs��fdd��jD�S)zList all known distributions.csg|]}���|��qSr)�_formatr��resultr"rrr�r	z&DistroInfo.get_all.<locals>.<listcomp>rJ)r"rNrrMr�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�r	z%DistroInfo._avail.<locals>.<listcomp>rJr6rrPr�_avail�szDistroInfo._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)rCr-r.r,)r"�namerRr0rrrr,�s
zDistroInfo.versioncs@�dur|j��fdd�|���D�}|s0t��|�||d�S)�<Get latest development distribution based on the given date.Ncs8g|]0}|jdus0�|jkr|jdus0�|jkr|�qSr+�r0r1rrPrrr�s(�z$DistroInfo.devel.<locals>.<listcomp>����rGrQrrL�r"rrN�distrosrrPr�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 "�"r0zQOnly codename, fullname, object, and release are allowed result values, but not 'z'.N)r.r<r,r-r)r"�
format_stringr0rrrrL�s���zDistroInfo._formatcs@�dur|j��fdd�|���D�}|s0t��|�||d�S)z7Get latest stable distribution based on the given date.Ncs8g|]0}|jdur�|jkr|jdus0�|jkr|�qSr+rUrrPrrr�s(�z%DistroInfo.stable.<locals>.<listcomp>rVrWrXrrPr�stable�s
�zDistroInfo.stablecCs
t��dS)z@Get list of all supported distributions based on the given date.N)�NotImplementedError)r"rrNrrr�	supported�szDistroInfo.supportedcCs
||jvS)�%Check if the given codename is known.)rK�r"r-rrr�valid�szDistroInfo.validcs8|dur�j}��|�����fdd���|�D�}|S)zBGet list of all unsupported distributions based on the given date.Ncs"g|]}|j�vr���|��qSr)r.rLr�rNr"rbrrr�r	z*DistroInfo.unsupported.<locals>.<listcomp>)rGrbrQrXrrfr�unsupported�s

zDistroInfo.unsupported)r-)NN)N)Nr-)Nr-)NN)Nr-)r%r&r'r(r �propertyrKrOrQr-r,rZrLr`rbrergrrrrr;es







r;csneZdZdZ�fdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�Zdd�Z�Z
S)�DebianDistroInfoz1provides information about Debian's distributionscst��d�dS)N�Debianrr!r#rrr �szDebianDistroInfo.__init__NcCsX|dkr|�|�}n@|dkr(|�|�}n,|dkr<|�|�}n|dkrP|�|�}n|}|S)z3Map 'unstable', 'testing', etc. to their codenames.�unstable�testingr`�	oldstable)rZrlr`�old)r"r0rrRr-rrrr-�szDebianDistroInfo.codenamer-csH�dur|j��fdd�|���D�}t|�dkr8t��|�||d�S)rTNcs8g|]0}|jdus0�|jkr|jdus0�|jkr|�qSr+rUrrPrrr�s(�z*DebianDistroInfo.devel.<locals>.<listcomp>r����rGrQrrrLrXrrPrrZ�s
�zDebianDistroInfo.develcsH�dur|j��fdd�|���D�}t|�dkr8t��|�||d�S)z=Get old (stable) Debian distribution based on the given date.Ncs$g|]}|jdur�|jkr|�qSr+)r0rrPrrr�r	z(DebianDistroInfo.old.<locals>.<listcomp>rrorprXrrPrrn�szDebianDistroInfo.oldcs.�dur�j����fdd�����D�}|S)zOGet list of all supported Debian distributions based on the given
        date.Ncs,g|]$}|jdus�|jkr���|��qSr+)r1rLr�rrNr"rrrsz.DebianDistroInfo.supported.<locals>.<listcomp>�rGrQrXrrqrrb�s�zDebianDistroInfo.supportedcs.�dur�j����fdd�����D�}|S)zSGet list of all LTS supported Debian distributions based on the given
        date.Ncs@g|]8}|jdur�|jkr|jdur�|jkr���|��qSr+)r1r2rLrrqrrrs�z2DebianDistroInfo.lts_supported.<locals>.<listcomp>rrrXrrqr�
lts_supported	s�zDebianDistroInfo.lts_supportedcs.�dur�j����fdd�����D�}|S)z\Get list of all Extended LTS supported Debian distributions based on
        the given date.Ncs@g|]8}|jdur�|jkr|jdur�|jkr���|��qSr+)r2r3rLrrqrrrs�z3DebianDistroInfo.elts_supported.<locals>.<listcomp>rrrXrrqr�elts_supporteds�zDebianDistroInfo.elts_supportedcs@�dur|j��fdd�|���D�}|s0t��|�||d�S)z?Get latest testing Debian distribution based on the given date.NcsHg|]@}|jdur|js@|jdur�|jkr|jdus@�|jkr|�qSr+)r0r,r1rrPrrr's(�z,DebianDistroInfo.testing.<locals>.<listcomp>rVrWrXrrPrrl#s
�zDebianDistroInfo.testingcCst�||�p|dvS)rc)rkrlr`rm)r;rerdrrrre1szDebianDistroInfo.valid)NN)Nr-)Nr-)Nr-)Nr-)Nr-)Nr-)r%r&r'r(r r-rZrnrbrsrtrlrer)rrr#rri�s


	




ricsFeZdZdZ�fdd�Zddd�Zdd	�Zdd
d�Zddd
�Z�Z	S)�UbuntuDistroInfoz1provides information about Ubuntu's distributionscst��d�dS)N�Ubunturr!r#rrr >szUbuntuDistroInfo.__init__Nr-cs<�dur|j��fdd�|jD�}|s,t��|�||d�S)zWGet latest long term support (LTS) Ubuntu distribution based on the
        given date.Ncs<g|]4}|j�d�dkr|j�kr0|jkrnq|�qS)�LTSr)r,�findr0r1rrPrrrFsz(UbuntuDistroInfo.lts.<locals>.<listcomp>rV)rGrCrrLrXrrPr�ltsAs
�zUbuntuDistroInfo.ltscs*�fdd�|jD�}|sdSd|djvS)zIs codename an LTS release?csg|]}|j�kr|�qSrrIr�r-rrrOr	z+UbuntuDistroInfo.is_lts.<locals>.<listcomp>Frwr)rCr,)r"r-rYrrzr�is_ltsMszUbuntuDistroInfo.is_ltscs.�dur�j����fdd�����D�}|S)zOGet list of all supported Ubuntu distributions based on the given
        date.Ncs6g|].}�|jks&|jdur�|jkr���|��qSr+)r1r5rLrrqrrrYs�z.UbuntuDistroInfo.supported.<locals>.<listcomp>rrrXrrqrrbTs�zUbuntuDistroInfo.supportedcs.�dur�j����fdd�����D�}|S)zSGet list of all ESM supported Ubuntu distributions based on the
        given date.Ncs,g|]$}|jdur�|jkr���|��qSr+)r4rLrrqrrres�z2UbuntuDistroInfo.supported_esm.<locals>.<listcomp>rrrXrrqr�
supported_esm`s�zUbuntuDistroInfo.supported_esm)Nr-)Nr-)Nr-)
r%r&r'r(r ryr{rbr|r)rrr#rru;s

ru)r(rBrr=rr�	Exceptionrr[r*r:r;rirurrrr�<module>s
(pf