%PDF- %PDF-
Direktori : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/format.cpython-312.pyc |
� $.Vf� � �6 � d dl Z d dlZd� Zd� Zd� Zdedefd�Zy)� Nc �p � t j | � r/t | � j d� d }| j � d|� d�S t j | � r/t | � j d� d }| j � d|� d�S | j j � d| j j � �S )zv Returns a fully-qualified name for the specified object, such as 'landscape.lib.format.format_object()'. � � �.z()� )�inspect�ismethod�repr�split� __module__� isfunction� __class__�__name__)�object�names �6/usr/lib/python3/dist-packages/landscape/lib/format.py� format_objectr s� � � ����� �F�|�!�!�#�&�q�)���#�#�$�A�d�V�2�.�.� � � �F� #��F�|�!�!�#�&�q�)���#�#�$�A�d�V�2�.�.����)�)� *�!�F�,<�,<�,E�,E�+F�G�G� c �( � | sd} t | � d�d�S )N� �.02f�s��float)�secondss r �format_deltar � � �����G�n�T� "�!�$�$r c �( � | sd} t | � d�d�S )Nr r �%r )�percents r �format_percentr! r r �pattern�returnc �� �� t j dt j � }|j � D ��ci c] \ }}|t |� �� c}}��fd�}t j ||| � S c c}}w )a� Expand the pattern by replacing the params with values in `kwargs`. This implements a small subset of shell parameter expansion and the patterns can only be in the following forms: - ${parameter} - ${parameter:offset} - start at `offset` to the end - ${parameter:offset:length} - start at `offset` to `offset + length` For simplicity, `offset` and `length` MUST be positive values. z8\$\{([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+))?(?::([0-9]+))?\}c �� �� | j d� }�|j � }| j d� | j d� }}|r"t |� }d }|r|t |� z }||| S |S )Nr r � )�group�lower�int)�match�param�result�offset�length�start�end�valuess �r �_replacezexpandvars.<locals>._replace3 sm �� ����A������� �&�����Q�����Q�������K�E��C���c�&�k�)���%��$�$�� r )�re�compile� MULTILINE�items�str�sub)r"