← Back
Editing: fields.cpython-311.pyc
� ��Oc � �@ � d dl Z d dlmZ G d� dej � � ZdS )� N)�basec � � e Zd ZdZd� ZdS )� FieldListz�Format values as a reStructuredText field list. For example:: : name1 : value : name2 : value : name3 : a long value will be wrapped with a hanging indent c # �� K � t |� � � � � D ]@\ }}d� ||�� � }t j |dd| j �� � }|dz V � �AdS )z�Format the data and return unicode text. :param data: A dictionary with string keys and simple types as values. :type data: dict(str:?) z: {name} : {value})�name�value� z )�initial_indent�subsequent_indent�width� N)�sorted�items�format�textwrap�fill� max_width)�self�datar r � full_text�wrapped_texts �;/usr/lib/python3/dist-packages/stevedore/example2/fields.pyr zFieldList.format! s� � � � � "�$�*�*�,�,�/�/� &� &�K�D�%�,�3�3��� 4� � �I� $�=��!�"(��n� � � �L� ��%�%�%�%�%� &� &� N)�__name__� __module__�__qualname__�__doc__r � r r r r s- � � � � � � � �&� &� &� &� &r r )r �stevedore.exampler � FormatterBaser r r r �<module>r! sY �� ���� "� "� "� "� "� "�&� &� &� &� &��"� &� &� &� &� &r
Save File
Cancel