Current Dir: /snap/core22/2437/usr/lib/python3/dist-packages/urwid/__pycache__/
[FILE] canvas.cpython-310.pyc [ edit | delete | rename ]
[FILE] command_map.cpython-310.pyc [ edit | delete | rename ]
[FILE] compat.cpython-310.pyc [ edit | delete | rename ]
[FILE] container.cpython-310.pyc [ edit | delete | rename ]
[FILE] curses_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] decoration.cpython-310.pyc [ edit | delete | rename ]
[FILE] display_common.cpython-310.pyc [ edit | delete | rename ]
[FILE] escape.cpython-310.pyc [ edit | delete | rename ]
[FILE] font.cpython-310.pyc [ edit | delete | rename ]
[FILE] graphics.cpython-310.pyc [ edit | delete | rename ]
[FILE] html_fragment.cpython-310.pyc [ edit | delete | rename ]
[FILE] lcd_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] listbox.cpython-310.pyc [ edit | delete | rename ]
[FILE] main_loop.cpython-310.pyc [ edit | delete | rename ]
[FILE] monitored_list.cpython-310.pyc [ edit | delete | rename ]
[FILE] numedit.cpython-310.pyc [ edit | delete | rename ]
[FILE] old_str_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] raw_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] signals.cpython-310.pyc [ edit | delete | rename ]
[FILE] split_repr.cpython-310.pyc [ edit | delete | rename ]
[FILE] text_layout.cpython-310.pyc [ edit | delete | rename ]
[FILE] treetools.cpython-310.pyc [ edit | delete | rename ]
[FILE] util.cpython-310.pyc [ edit | delete | rename ]
[FILE] version.cpython-310.pyc [ edit | delete | rename ]
[FILE] vterm.cpython-310.pyc [ edit | delete | rename ]
[FILE] web_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] widget.cpython-310.pyc [ edit | delete | rename ]
[FILE] wimp.cpython-310.pyc [ edit | delete | rename ]
[FILE] _async_kw_event_loop.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]
Viewing: /snap/core22/2437/usr/lib/python3/dist-packages/urwid/__pycache__/split_repr.cpython-310.pyc
o
��o_� � @ s| d dl mZmZ d dlmZmZ esd dlmZ nd dlmZ dd� Z dd� Z
d d
� Zdd� Zd
d� Z
edkr<e
� dS dS )� )�division�print_function)�PYTHON3�bytes)�
getargspec)�getfullargspecc C sz dd� | � � �� D �}|�� | �� }|s|st| j| ��� S |r(|r(|�d� d| jjd� |�d� dd� |D �� f S )a�
Return a helpful description of the object using
self._repr_words() and self._repr_attrs() to add
to the description. This function may be used by
adding code to your class like this:
>>> class Foo(object):
... __repr__ = split_repr
... def _repr_words(self):
... return ["words", "here"]
... def _repr_attrs(self):
... return {'attrs': "appear too"}
>>> Foo()
<Foo words here attrs='appear too'>
>>> class Bar(Foo):
... def _repr_words(self):
... return Foo._repr_words(self) + ["too"]
... def _repr_attrs(self):
... return dict(Foo._repr_attrs(self), barttr=42)
>>> Bar()
<Bar words here too attrs='appear too' barttr=42>
c S s g | ]\}}t |�t|�f�qS � )�str�normalize_repr��.0�k�vr r �2/usr/lib/python3/dist-packages/urwid/split_repr.py�
<listcomp>5 s �zsplit_repr.<locals>.<listcomp>� z<%s %s>� c S � g | ]}d | �qS )z%s=%sr �r �itmr r r r @ s )
�_repr_attrs�items�sort�_repr_words�super� __class__�__repr__�append�__name__�join)�self�alist�wordsr r r �
split_repr s
���r# c C sH t | t�r dd� | �� D �}|�� dd�dd� |D �� d S t| �S )z�
Return dictionary repr sorted by keys, leave others unchanged
>>> normalize_repr({1:2,3:4,5:6,7:8})
'{1: 2, 3: 4, 5: 6, 7: 8}'
>>> normalize_repr('foo')
"'foo'"
c S s g | ]\}}t |�t |�f�qS r )�reprr r r r r L s z"normalize_repr.<locals>.<listcomp>�{z, c S r )z%s: %sr r r r r r N s ��})�
isinstance�dictr r r r$ )r r r r r r
B s
��r
c C s8 t | �}tst| t�rd| S |�d�r|dd� S |S )z�
Return strings and byte strings as they appear in Python 3
>>> python3_repr(u"text")
"'text'"
>>> python3_repr(bytes())
"b''"
�b�u� N)r$ r r'