
    8g%R                     r   S r SSKrSSKrSSKrSSKrS\S\R                  4S jrS\4S jr " S S\	5      r
 " S	 S
5      r\R                  S   r\R                  S   r\R                  \\4   rS\\\4   S\S\R$                  \R                     4S jr " S S5      r " S S\5      r " S S\5      rg)z>provides information about Ubuntu's and Debian's distributions    Nstringreturnc                    U R                  S5       Vs/ s H  n[        U5      PM     nn[        U5      S:X  a  Uu  p4n[        R                  " X4U5      $ [        U5      S:X  aR  Uu  p4US:X  a  [        R                  " X4S5      $ [        R                  " X4S-   S5      [        R
                  " S5      -
  $ [        S5      es  snf )z9Convert a date string in ISO 8601 into a datetime object.-               zDate not in ISO 8601 format.)splitintlendatetimedate	timedelta
ValueError)r   xpartsyearmonthdays         -/usr/lib/python3/dist-packages/distro_info.pyconvert_dater      s    #\\#./.SV.E/
5zQ"c}}T#..
5zQB;==b11}}T19a083E3Ea3HHH
3
44 0s   Cc                      g)z4Get the data directory based on the module location.z/usr/share/distro-info r       r   _get_data_dirr   %   s    #r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )DistroDataOutdated*   zDistribution data outdated.c                 $   > [         TU ]  S5        g )NzDistribution 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__s    r   r$   DistroDataOutdated.__init__-   s    M	
r   r   r   N)__name__
__module____qualname____firstlineno____doc__r$   __static_attributes____classcell__r'   s   @r   r   r   *   s    %
 
r   r   c                      \ rS rSrSr      SS\S\S\S\R                  S\R                  \R                     S	\R                  \R                     S
\R                  \R                     S\R                  \R                     S\R                  \R                     S\R                  \R                     SS4S jjr
S\R                  S\4S jrSrg)DistroRelease5   z"Represents a distributions releaseNversioncodenameseriescreatedreleaseeoleol_esmeol_ltseol_elts
eol_serverr   c                 |    Xl         X l        X0l        X@l        XPl        X`l        Xl        Xl        Xpl        Xl	        g N)
r5   r6   r7   r8   r9   r:   r<   r=   r;   r>   )r&   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   s              r   r$   DistroRelease.__init__9   s6       $r   r   c                     XR                   :  =(       aM    U R                  SL =(       d8    XR                  :*  =(       d#    U R                  SL=(       a    XR                  :*  $ )z:Check whether this release is supported on the given date.N)r8   r:   r>   )r&   r   s     r   is_supportedDistroRelease.is_supportedQ   sP    ||# 
HH IxxIt+G0G	
r   )
r6   r8   r:   r=   r;   r<   r>   r9   r7   r5   )NNNNNN)r*   r+   r,   r-   r.   strr   r   typingOptionalr$   boolrC   r/   r   r   r   r3   r3   5   s    , 37.226263759%% % 	%
 % /% __X]]+% /% /% //(--0% OOHMM2% 
%0
 
4 
r   r3   object)r6   fullnamer9   rowcolumnc                 J    U R                  U5      nU(       d  g [        U5      $ r@   )getr   )rK   rL   date_strings      r   	_get_daterP   _   s     ''&/K$$r   c                      \ rS rSrSrS\SS4S jr\S\\   4S j5       r	\
R                  S\S\\   4S	 j5       r\
R                  S*S\S\\   4S jj5       r S*S\S\
R"                  \\   \\   4   4S jjrS\R&                  S\\   4S jr  S+S\S\
R*                  \R&                     S\
R*                  \   S\
R"                  \\S4   4S jjrS,S\S\
R*                  \   S\
R*                  \   4S jjr\
R                   S,S\
R*                  \R&                     S\S\4S jj5       r\
R                   S-S\
R*                  \R&                     S\S\4S jj5       r S-S\
R*                  \R&                     S\S\
R"                  \\4   4S jjr\
R                  S\S\S\4S j5       r\
R                  S\S\S\4S j5       rS\S\S\
R"                  \\4   4S jr\
R                  S\S\
R4                  \   S\\   4S j5       r\
R                  S\S\
R4                  \   S\\   4S j5       rS\S\
R4                  \   S\
R"                  \\   \\   4   4S jr\
R                   S,S\
R*                  \R&                     S\S\4S jj5       r\
R                   S-S\
R*                  \R&                     S\S\4S  jj5       r S-S\
R*                  \R&                     S\S\
R"                  \\4   4S! jjr\
R                   S,S\
R*                  \R&                     S\S\\   4S" jj5       r\
R                   S-S\
R*                  \R&                     S\S\\   4S# jj5       r S-S\
R*                  \R&                     S\S\
R"                  \\   \\   4   4S$ jjrS
\S\4S% jr\
R                   S,S\
R*                  \R&                     S\S\\   4S& jj5       r \
R                   S-S\
R*                  \R&                     S\S\\   4S' jj5       r  S-S\
R*                  \R&                     S\S\
R"                  \\   \\   4   4S( jjr S)r!g).
DistroInfof   zrBase class for distribution information.
Use DebianDistroInfo or UbuntuDistroInfo instead of using this directly.
distror   Nc                    Xl         [        R                  R                  [	        5       UR                  5       S-   5      n[        USS9 n[        R                  " U5      n/ U l	        U H  n[        US   US   US   [        US   5      [        US5      [        US	5      [        US
5      [        US5      [        US5      [        US5      5
      nU R                  R                  U5        M     S S S 5        [        R                  R                  S5      nUb.  [         R"                  R%                  ['        U5      5      U l        g [         R"                  R+                  5       U l        g ! , (       d  f       N= f)Nz.csvzutf-8)encodingr5   r6   r7   r8   r9   r:   zeol-esmzeol-ltszeol-eltsz
eol-serverSOURCE_DATE_EPOCH)_distroospathjoinr   loweropencsv
DictReader	_releasesr3   r   rP   appendenvironrN   r   r   fromtimestampr   _datetoday)r&   rT   filenamecsvfile
csv_readerrK   r9   source_date_epochs           r   r$   DistroInfo.__init__k   s(   77<<&1HI(W-0JDN!'	N
OM Y0c9-c5)c9-c9-c:.c<0 %%g. " ." JJNN+>?(!44S9J5KLDJ!,,.DJ+ .-s   
B'E--
E;c                 X    U R                    Vs/ s H  oR                  PM     sn$ s  snf )z*List codenames of all known distributions.)r`   r7   )r&   r   s     r   allDistroInfo.all   s"     #'..1.Q.111s   'resultc                     g r@   r   r&   rn   s     r   get_allDistroInfo.get_all   s    EHr   r6   c                     g r@   r   rp   s     r   rq   rr      s    KNr   c                 8    U R                  XR                  5      $ )zList all known distributions.)_format_listr`   rp   s     r   rq   rr      s       88r   r   c                 h    U R                    Vs/ s H  o!UR                  :  d  M  UPM     sn$ s  snf )z?Return all distributions that were available on the given date.)r`   r8   )r&   r   r   s      r   _availDistroInfo._avail   s'    >>?>aQYY->>???s   //r9   defaultc                     U$ )z3Map codename aliases to the codename they describe.r   r&   r9   r   ry   s       r   r6   DistroInfo.codename   s	     r   namec                 ~    U R                    H,  nXR                  UR                  4;   d  M   UR                  s  $    U$ )z!Map codename or series to version)r`   r6   r7   r5   )r&   r}   ry   r9   s       r   r5   DistroInfo.version   s6    ~~G(('..99& & r   c                    g r@   r   r&   r   rn   s      r   develDistroInfo.devel        r   c                     g r@   r   r   s      r   r   r           r   c                 .   Uc  U R                   nU R                  U5       Vs/ s HA  nUR                  b/  XR                  :  d  M!  UR                  b  XR                  ::  d  M?  UPMC     nnU(       d
  [	        5       eU R                  X$S   5      $ s  snf )<Get latest development distribution based on the given date.rd   rw   r9   r:   r   _formatr&   r   rn   r   distross        r   r   r      s     <::D [[&
&yy TII%5 ;<55=DTYTYM & 	 

 $&&||FBK00
s    BB%Bformat_stringc                     g r@   r   r&   r   r9   s      r   r   DistroInfo._format   s    ^ar   c                     g r@   r   r   s      r   r   r      s    WZr   c                     US:X  a  U$ US:X  a  UR                   $ US:X  a/  U R                  S-   UR                  -   S-   UR                  -   S-   $ US:X  a  UR                  $ [	        SU-   S	-   5      e)
z"Format a given distribution entry.rI   r6   rJ    z ""r9   zQOnly codename, fullname, object, and release are allowed result values, but not 'z'.)r7   rX   r5   r6   r   r   s      r   r   r      s     H$NJ&>>!J&<<#%7$>AQAQQTWWWI%??"')679=>
 	
r   releasesc                     g r@   r   r&   r   r   s      r   ru   DistroInfo._format_list        "r   c                     g r@   r   r   s      r   ru   r           r   c                     U Vs/ s H  o0R                  X5      PM     nnUS:X  a"  [        R                  " [        [           U5      $ [        R                  " [        [
           U5      $ s  snf )z*Format a sequence of distribution entries.rI   )r   rF   castlistr3   rE   )r&   r   r   r   r   s        r   ru   r      sd    
 5=F
4<qLL*H 	 F
 H$;;tM2G<<{{49g..F
s   A+c                    g r@   r   r   s      r   stableDistroInfo.stable   r   r   c                     g r@   r   r   s      r   r   r      r   r   c                 2   Uc  U R                   nU R                  U5       Vs/ s HC  nUR                  c  M  XR                  :  d  M#  UR                  b  XR                  ::  d  MA  UPME     nnU(       d
  [	        5       eU R                  X$S   5      $ s  snf )z7Get latest stable distribution based on the given date.r   r   r   s        r   r   r      s     <::D [[&
&yy )-): @AQUY^Y^Q^ & 	 

 $&&||FBK00
s   BB	B'Bc                    g r@   r   r   s      r   	supportedDistroInfo.supported
  r   r   c                     g r@   r   r   s      r   r   r     r   r   c                     [        5       e)z@Get list of all supported distributions based on the given date.)NotImplementedErrorr   s      r   r   r     s     "##r   c                     XR                   ;   $ )%Check if the given codename is known.)rl   r&   r6   s     r   validDistroInfo.valid  s    88##r   c                    g r@   r   r   s      r   unsupportedDistroInfo.unsupported  r   r   c                     g r@   r   r   s      r   r   r   #  r   r   c                     Uc  U R                   nU R                  U5      nU R                  X R                  U5       Vs/ s H  oDR                  U;  d  M  UPM     sn5      $ s  snf )zBGet list of all unsupported distributions based on the given date.)rd   r   ru   rw   r7   )r&   r   rn   r   r   s        r   r   r   (  s\     <::DNN4(	  D 1O 11XXY5NQ 1O
 	
Os   A#
A#
)rd   rX   r`   )r6   NNr@   Nr6   )"r*   r+   r,   r-   r.   rE   r$   propertyr   rl   rF   overload_ObjectResultr3   rq   _NonObjectResult
_AnyResultUnionr   r   rw   rG   r6   r5   r   r   Sequenceru   r   r   rH   r   r   r/   r   r   r   rR   rR   f   s   /s /t /4 2T#Y 2 2 __HmH]0CH H__N.NS	N N $.9 9	d=)494	59@8== @T--@ @ 04(,	 oohmm, %	
 
mS$.	/C &//#*> &//Z]J^  __59OOHMM2FS	  __V`OOHMM2CS	 
 Q[1OOHMM21CM1	mS(	)1 __a]a]a}a a__Z%5ZZRUZ Z
'
2?
	mS(	)
$ __"*"6<oom6T"	m	" " __-9?9W	c 	/'	/39??=3Q	/	d=)494	5	/ __59OOHMM2FS	  __V`OOHMM2CS	 
 Q[1OOHMM21CM1	mS(	)1 __59"OOHMM2"FS"	m	" " __V`OOHMM2CS	c 
 Q[$OOHMM2$CM$	d=)494	5$$c $d $ __59"OOHMM2"FS"	m	" " __V`OOHMM2CS	c 
 Q[	
OOHMM2	
CM	
	d=)494	5	
 	
r   rR   c                   d  ^  \ rS rSrSrS U 4S jjr  S!S\S\R                  \	R                     S\R                  \   S\R                  \\S4   4S	 jjr\R                   S"S\R                  \	R                     S
\S\4S jj5       r\R                   S#S\R                  \	R                     S
\S\4S jj5       r S#S\R                  \	R                     S
\S\R                  \\4   4S jjr\R                   S"S\R                  \	R                     S
\S\4S jj5       r\R                   S#S\R                  \	R                     S
\S\4S jj5       r S#S\R                  \	R                     S
\S\R                  \\4   4S jjr\R                   S"S\R                  \	R                     S
\S\\   4S jj5       r\R                   S#S\R                  \	R                     S
\S\\   4S jj5       r S#S\R                  \	R                     S
\S\R                  \\   \\   4   4S jjr\R                   S"S\R                  \	R                     S
\S\\   4S jj5       r\R                   S#S\R                  \	R                     S
\S\\   4S jj5       r S#S\R                  \	R                     S
\S\R                  \\   \\   4   4S jjr\R                   S"S\R                  \	R                     S
\S\\   4S jj5       r\R                   S#S\R                  \	R                     S
\S\\   4S jj5       r S#S\R                  \	R                     S
\S\R                  \\   \\   4   4S jjr\R                   S"S\R                  \	R                     S
\S\4S jj5       r\R                   S#S\R                  \	R                     S
\S\4S jj5       r S#S\R                  \	R                     S
\S\R                  \\4   4S jjrS\S\4S jrSrU =r$ )$DebianDistroInfoi4  z1provides information about Debian's distributionsr   Nc                 $   > [         TU ]  S5        g )NDebianr"   r%   s    r   r$   DebianDistroInfo.__init__7      "r   r9   r   ry   c                     US:X  a  U R                  U5      $ US:X  a  U R                  U5      $ US:X  a  U R                  U5      $ US:X  a  U R                  U5      $ U$ )z3Map 'unstable', 'testing', etc. to their codenames.unstabletestingr   	oldstable)r   r   r   oldr{   s       r   r6   DebianDistroInfo.codename:  sd     j ::d##i<<%%h;;t$$k!88D>!r   rn   c                    g r@   r   r   s      r   r   DebianDistroInfo.develK  r   r   r6   c                     g r@   r   r   s      r   r   r   P  s    
 r   c                 >   Uc  U R                   nU R                  U5       Vs/ s HA  nUR                  b/  XR                  :  d  M!  UR                  b  XR                  ::  d  M?  UPMC     nn[	        U5      S:  a
  [        5       eU R                  X$S   5      $ s  snf )r   r   )rd   rw   r9   r:   r   r   r   r   s        r   r   r   Y  s     <::D [[&
&yy TII%5 ;<55=DTYTYM & 	 

 w<!$&&||FBK00
s    BB%Bc                    g r@   r   r   s      r   r   DebianDistroInfo.oldh  r   r   c                     g r@   r   r   s      r   r   r   m  r   r   c                    Uc  U R                   nU R                  U5       Vs/ s H$  o3R                  c  M  XR                  :  d  M"  UPM&     nn[        U5      S:  a
  [	        5       eU R                  X$S   5      $ s  snf )z=Get old (stable) Debian distribution based on the given date.r   r   )rd   rw   r9   r   r   r   r   s        r   r   r   r  sp     <::D"kk$/_/991TU^U^M^1/_w<!$&&||FBK00 `s   A=A=A=c                    g r@   r   r   s      r   r   DebianDistroInfo.supported}  r   r   c                     g r@   r   r   s      r   r   r         
 r   c                     Uc  U R                   nU R                  U5       Vs/ s H"  o3R                  b  XR                  ::  d  M   UPM$     nnU R                  X$5      $ s  snf )zGGet list of all supported Debian distributions based on the given
date.)rd   rw   r:   ru   r   s        r   r   r     sV    
 <::D"kk$/R/55=DEEM1/R  11 Ss   AAc                    g r@   r   r   s      r   lts_supportedDebianDistroInfo.lts_supported  r   r   c                     g r@   r   r   s      r   r   r     r   r   c                    Uc  U R                   nU R                  U5       Vs/ s HE  nUR                  c  M  XR                  :  d  M#  UR                  c  M2  XR                  ::  d  MC  UPMG     nnU R	                  X$5      $ s  snf )zKGet list of all LTS supported Debian distributions based on the given
date.)rd   rw   r:   r<   ru   r   s        r   r   r     s    
 <::D [[&
& &*UUl    ,099+< & 	 
   11
   BB	BB)Bc                    g r@   r   r   s      r   elts_supportedDebianDistroInfo.elts_supported  r   r   c                     g r@   r   r   s      r   r   r     r   r   c                    Uc  U R                   nU R                  U5       Vs/ s HE  nUR                  c  M  XR                  :  d  M#  UR                  c  M2  XR                  ::  d  MC  UPMG     nnU R	                  X$5      $ s  snf )zTGet list of all Extended LTS supported Debian distributions based on
the given date.)rd   rw   r<   r=   ru   r   s        r   r   r     s    
 <::D [[&
&		 *.*:    -1JJ,> & 	 
   11
r   c                    g r@   r   r   s      r   r   DebianDistroInfo.testing  r   r   c                     g r@   r   r   s      r   r   r     r   r   c                 n   Uc  U R                   nU R                  U5       Vs/ s Ha  nUR                  c  UR                  (       d>  UR                  c  M0  XR                  :  d  MA  UR                  b  XR                  ::  d  M_  UPMc     nnU(       d
  [        5       eU R                  X$S   5      $ s  snf )z?Get latest testing Debian distribution based on the given date.r   )rd   rw   r9   r5   r:   r   r   r   s        r   r   r     s     <::D [[&
&		!aii		  +/*:  ABQUY^Y^Q^ & 	 
 $&&||FBK00
s   /B2B2'B2B2c                 D    [         R                  X5      =(       d    US;   $ )r   )r   r   r   r   )rR   r   r   s     r   r   DebianDistroInfo.valid  s'    / 
8 @
 4
 	
r   r   r)   r   r@   r   )r*   r+   r,   r-   r.   r$   rE   rF   rG   r   r   r   r3   r6   r   r   r   r   r   r   r   r   r   r   r   rH   r   r/   r0   r1   s   @r   r   r   4  s4   ;# 04(,	 oohmm, %	
 
mS$.	/" __59OOHMM2FS	  __ WaOOHMM2CS	  Q[1OOHMM21CM1	mS(	)1 __59OOHMM2FS	  __V`OOHMM2CS	 
 Q[	1OOHMM2	1CM	1	mS(	)	1 __59"OOHMM2"FS"	m	" " __ WaOOHMM2CS	c  Q[2OOHMM22CM2	d=)494	52 __59"OOHMM2"FS"	m	" " __V`OOHMM2CS	c 
 Q[2OOHMM22CM2	d=)494	52 __59"OOHMM2"FS"	m	" " __V`OOHMM2CS	c 
 Q[2OOHMM22CM2	d=)494	52 __59OOHMM2FS	  __V`OOHMM2CS	 
 Q[1OOHMM21CM1	mS(	)1 
c 
d 
 
r   r   c            
         ^  \ rS rSrSrSU 4S jjr\R                   SS\R                  \	R                     S\S\4S jj5       r\R                   SS\R                  \	R                     S\S\4S	 jj5       r SS\R                  \	R                     S\S\R"                  \\4   4S
 jjrS\S\4S jr\R                   SS\R                  \	R                     S\S\\   4S jj5       r\R                   SS\R                  \	R                     S\S\\   4S jj5       r SS\R                  \	R                     S\S\R"                  \\   \\   4   4S jjr\R                   SS\R                  \	R                     S\S\\   4S jj5       r\R                   SS\R                  \	R                     S\S\\   4S jj5       r SS\R                  \	R                     S\S\R"                  \\   \\   4   4S jjrSrU =r$ )UbuntuDistroInfoi  z1provides information about Ubuntu's distributionsr   c                 $   > [         TU ]  S5        g )NUbuntur"   r%   s    r   r$   UbuntuDistroInfo.__init__  r   r   r   rn   c                    g r@   r   r   s      r   ltsUbuntuDistroInfo.lts  r   r   r6   c                     g r@   r   r   s      r   r   r     r   r   c                    Uc  U R                   nU R                   Vs/ s Hs  nUR                  R                  S5      S:  d  M$  UR                  (       d  M7  UR
                  (       d  MJ  UR                  Us=::  a  UR
                  ::  d  Mm  O  Mq  UPMu     nnU(       d
  [        5       eU R                  X$S   5      $ s  snf )zOGet latest long term support (LTS) Ubuntu distribution based on the
given date.LTSr   r   )rd   r`   r5   findr9   r:   r   r   r   s        r   r   r     s    
 <::D ^^
#yy~~e$) ./ii <=EE FGiiSWF`[\[`[`F` F` # 	 

 $&&||FBK00
s#   #B?B?B?+B?B?B?c                     U R                    Vs/ s H  o"R                  U:X  d  M  UPM     nnU(       d  gSUS   R                  ;   $ s  snf )zIs codename an LTS release?Fr   r   )r`   r7   r5   )r&   r6   r   r   s       r   is_ltsUbuntuDistroInfo.is_lts  sD    "nnEnH0D1nE
**** Fs
   AAc                    g r@   r   r   s      r   r   UbuntuDistroInfo.supported  r   r   c                     g r@   r   r   s      r   r   r     r   r   c                    Uc  U R                   nU R                  U5       Vs/ s HE  nUR                  (       a  XR                  ::  d   UR                  c  M2  XR                  ::  d  MC  UPMG     nnU R	                  X$5      $ s  snf )zGGet list of all supported Ubuntu distributions based on the given
date.)rd   rw   r:   r>   ru   r   s        r   r   r      s{    
 <::D [[&
&$%%-Q\\ JNR^R^J^ & 	 

   11
s   1BB)Bc                    g r@   r   r   s      r   supported_esmUbuntuDistroInfo.supported_esm.  r   r   c                     g r@   r   r   s      r   r   r   3  r   r   c                     Uc  U R                   nU R                  U5       Vs/ s H$  o3R                  c  M  XR                  ::  d  M"  UPM&     nnU R                  X$5      $ s  snf )zKGet list of all ESM supported Ubuntu distributions based on the
given date.)rd   rw   r;   ru   r   s        r   r   r   8  sY    
 <::D"kk$/_/991TU^U^M^1/_  11 `s   A!A!A!r   r)   r@   r   )r*   r+   r,   r-   r.   r$   rF   r   rG   r   r   r   r3   r   r   rE   r   r   rH   r   r   r   r   r/   r0   r1   s   @r   r   r     s   ;# __59OOHMM2FS	  __V`OOHMM2CS	 
 Q[1OOHMM21CM1	mS(	)1 +s +t + __59"OOHMM2"FS"	m	" " __ WaOOHMM2CS	c  Q[2OOHMM22CM2	d=)494	52 __59"OOHMM2"FS"	m	" " __V`OOHMM2CS	c 
 Q[2OOHMM22CM2	d=)494	52 2r   r   )r.   r^   r   rY   rF   rE   r   r   r   	Exceptionr   r3   Literalr   r   r   r   dictrG   rP   rR   r   r   r   r   r   <module>r     s    E 
  	 5 5 5$s $

 
"
 "
J x(>>"CD \\-)99:
%4S> %3 %6??8==3Q %K
 K
\t
z t
nU2z U2r   