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|ddlmZmZddlmZmZesddlmZnddlmZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
edkr<e
�dSdS)�)�division�print_function)�PYTHON3�bytes)�
getargspec)�getfullargspeccCszdd�|����D�}|��|��}|s|st|j|���S|r(|r(|�d�d|jjd�	|�d�	dd�|D��fS)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>
    cSs g|]\}}t|�t|�f�qS�)�str�normalize_repr��.0�k�vrr�2/usr/lib/python3/dist-packages/urwid/split_repr.py�
<listcomp>5s�zsplit_repr.<locals>.<listcomp>�z<%s %s>� cS�g|]}d|�qS)z%s=%sr�r�itmrrrr@s)
�_repr_attrs�items�sort�_repr_words�super�	__class__�__repr__�append�__name__�join)�self�alist�wordsrrr�
split_reprs
���r#cCsHt|t�r dd�|��D�}|��dd�dd�|D��dSt|�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'"
    cSs g|]\}}t|�t|�f�qSr)�reprrrrrrLs z"normalize_repr.<locals>.<listcomp>�{z, cSr)z%s: %srrrrrrNs��})�
isinstance�dictrrrr$)rrrrrr
Bs
	��r
cCs8t|�}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$rr'r�
startswith)r�rrrr�python3_reprSs	

r.c	Cs�tst|�\}}}}nt|�\}}}}}}}|r|d=|r |d=ttt|t|�t|�d�|���}t|���D]}||vrJ||||krJ||=q9|S)a�
    Remove keys in d that are set to the default values from
    fn.  This method is used to unclutter the _repr_attrs()
    return value.

    d will be modified by this function.

    Returns d.

    >>> class Foo(object):
    ...     def __init__(self, a=1, b=2):
    ...         self.values = a, b
    ...     __repr__ = split_repr
    ...     def _repr_words(self):
    ...         return ["object"]
    ...     def _repr_attrs(self):
    ...         d = dict(a=self.values[0], b=self.values[1])
    ...         return remove_defaults(d, Foo.__init__)
    >>> Foo(42, 100)
    <Foo object a=42 b=100>
    >>> Foo(10, 2)
    <Foo object a=10>
    >>> Foo()
    <Foo object>
    ���N)rrrr(�list�zip�len�keys)	�d�fn�args�varargs�varkw�defaults�_�ddictr
rrr�remove_defaultsfs&�r<cCsddl}|��dS)Nr)�doctest�testmod)r=rrr�_test�sr?�__main__N)�
__future__rr�urwid.compatrr�inspectrrr#r
r.r<r?rrrrr�<module>s$2
�
Upload File: