Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/oslo_utils/__pycache__/versionutils.cpython-39.pyc
Ðазад
a s�h� � @ sN d Z ddlZddlZddlZddlmZ d dd�Zdd� Zd d � Z dd� Z dS )z? Helpers for comparing version strings. .. versionadded:: 1.6 � N)�_Tc C s4 t j�| �}t j�|�}|r,|j|jkr,dS ||kS )ap Determine whether `requested_version` is satisfied by `current_version`; in other words, `current_version` is >= `requested_version`. :param requested_version: version to check for compatibility :param current_version: version to check against :param same_major: if True, the major version must be identical between `requested_version` and `current_version`. This is used when a major-version difference indicates incompatibility between the two versions. Since this is the common-case in practice, the default is True. :returns: True if compatible, False if not F)� packaging�version�Version�major)Zrequested_version�current_versionZ same_major� requested�current� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/oslo_utils/versionutils.py� is_compatible s r c C sr z2t | t�rt| �} t | t�r0t�dd� | �W S W n: tyl } z"td�| }t|�|�W Y d}~n d}~0 0 dS )z�Convert a version to an integer. *version* must be a string with dots or a tuple of integers. .. versionadded:: 2.0 c S s | d | S )N�� r )�x�yr r r �<lambda>A � z(convert_version_to_int.<locals>.<lambda>zVersion %s is invalid.N) � isinstance�str�convert_version_to_tuple�tuple� functools�reduce� Exceptionr � ValueError)r �ex�msgr r r �convert_version_to_int6 s r c C sJ g }d}| dkr:| | | | }|� dt|�� | | } qd�tt|��S )zPConvert a version integer to a string with dots. .. versionadded:: 2.0 r r �.)�insertr �join�map)Zversion_intZversion_numbers�factorZversion_numberr r r �convert_version_to_strG s r"