+
    3Øži³  ã                   ó\   € R t ^ RIt^ RIHtHt  ! R R]4      tR R ltR R ltR	 R
 ltR# )z­
S390xGeneration

This module provides functionality to determine the generation of the
s390x architecture based on the machine type.

Author: Simon Johnsson
Version: 0.0.1
N)ÚEnumÚautoc                   óÀ   a € ] tR t^t o Rt]! 4       t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
tV tR# )ÚS390xGenerationzs
S390xGeneration

This Enum class provides constants representing different generations
of the S390x architecture.
c                ó$   <€ V ^8„  d   QhRRRS[ /# ©é   Úotherr   Úreturn©Úbool)ÚformatÚ__classdict__s   "€Ú=/usr/lib/python3/dist-packages/DistUpgrade/S390xGeneration.pyÚ__annotate__ÚS390xGeneration.__annotate__"   ó   ø€ ÷ (ñ (Ð-ð (±$ñ (ó    c                ó4   € V P                   VP                   8  # ©N©Úvalue©Úselfr	   s   &&r   Ú__lt__ÚS390xGeneration.__lt__"   ó   € Ø�z‰z˜EŸK™KÑ'Ð'r   c                ó$   <€ V ^8„  d   QhRRRS[ /# r   r   )r   r   s   "€r   r   r   %   r   r   c                ó4   € V P                   VP                   8„  # r   r   r   s   &&r   Ú__gt__ÚS390xGeneration.__gt__%   r   r   c                ó$   <€ V ^8„  d   QhRRRS[ /# r   r   )r   r   s   "€r   r   r   (   ó   ø€ ÷ )ñ )Ð-ð )±$ñ )r   c                ó4   € V P                   VP                   8*  # r   r   r   s   &&r   Ú__le__ÚS390xGeneration.__le__(   ó   € Ø�z‰z˜UŸ[™[Ñ(Ð(r   c                ó$   <€ V ^8„  d   QhRRRS[ /# r   r   )r   r   s   "€r   r   r   +   r"   r   c                ó4   € V P                   VP                   8¬  # r   r   r   s   &&r   Ú__ge__ÚS390xGeneration.__ge__+   r&   r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚZEC12ÚZ13ÚZ14ÚZ15ÚZ16ÚZ17r   r   r$   r)   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s^   ø‡ € ññ ‹F€EÙ
‹&€CÙ
‹&€CÙ
‹&€CÙ
‹&€CÙ
‹&€C÷(ð (÷(ð (÷)ð )÷)ö )r   r   c                ó>   € V ^8„  d   QhR\         R\        R,          /# )r   Úmachine_typer
   N)Úintr   )r   s   "r   r   r   /   s   € ÷ %ñ %¬cð %´oÈÕ6Lñ %r   c                ó¨  € R\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R	\         P
                  R
\         P
                  R\         P                  R\         P                  /pVP                  V 4      # )z¾
Get the S390x generation corresponding to the given machine type.

Returns:
    S390xGeneration | None: The corresponding S390x generation, or None if
    the machine code is unrecognized.
i  i  i”  i•  iB  iC  iq!  ir!  i[  i\  i×#  iØ#  )r   r1   r2   r3   r4   r5   r6   Úget)r:   Úmappings   & r   Ú_machine_type_to_generationr?   /   s    € ð 	Œo×#Ñ#ØŒo×#Ñ#àŒo×!Ñ!ØŒo×!Ñ!àŒo×!Ñ!ØŒo×!Ñ!àŒo×!Ñ!ØŒo×!Ñ!àŒo×!Ñ!ØŒo×!Ñ!àŒo×!Ñ!ØŒo×!Ñ!ð%+€Gð( �;‰;�|Ó$Ð$r   c                ó2   € V ^8„  d   QhR\         R,          /# ©r   r
   N)r;   )r   s   "r   r   r   N   s   € ÷ ñ œC $�Jñ r   c                 ó”  €  \        RR4      ;_uu_ 4       p V  Fw  pVP                  R4      w  r#pVP                  4       R8X  g   K.  VP                  4       P                  4       '       g   KT  \	        VP                  4       4      u uuRRR4       # 	  RRR4       R#   + '       g   i     R# ; i  \
        \        3 d     R# i ; i)z�
Read the machine type from /proc/sysinfo.

Returns:
    int | None: The machine type as an integer, or None if it cannot be
    determined.
z/proc/cpuinfoÚrÚ:ÚmachineN)ÚopenÚ	partitionÚstripÚisdigitr;   ÚFileNotFoundErrorÚ
ValueError)ÚfÚlineÚkeyÚ_r   s        r   Ú_read_machine_typerP   N   s›   € ðÜ�/ 3×'Ô'¨1Û�Ø $§¡¨sÓ 3‘�˜Ø—9‘9“; )Ö+°·±³×0EÑ0E×0GÔ0GÜ˜uŸ{™{›}Ó-Ñ-÷	 (Ò'Ù÷ (ñ ÷ (Ö'ñ ûô œzÐ*ô ÚðúsF   ‚B2 –,BÁ!BÁ-BÂ
B2 ÂBÂB2 ÂB/	Â)B2 Â/B2 Â2CÃCc                ó2   € V ^8„  d   QhR\         R,          /# rA   )r   )r   s   "r   r   r   a   s   € ÷ 
5ñ 
5¤_°tÕ%;ñ 
5r   c                 ód   € \        4       p V f   \        P                  ! R4       R# \        V 4      # )z�
Return the current running s390x generation, otherwise None if not running
on s390x architecture or if the generation cannot be determined.
Nz/Failed to read machine type from /proc/cpuinfo!)rP   ÚloggingÚwarningr?   )r:   s    r   Úget_system_s390x_generationrU   a   s-   € ô
 &Ó'€LØÒÜ�ŠÐIÔJÙä& |Ó4Ð4r   )	r0   rS   Úenumr   r   r   r?   rP   rU   r+   r   r   Ú<module>rW      s-   ðñó ç ô)�dô )õ<%õ>÷&
5r   