
    ;OOfo                     z    d dl mZmZ d dlmZmZ esd dlmZ nd dlmZ d Z	d Z
d Zd Zd	 Zed
k(  r e        yy)    )divisionprint_function)PYTHON3bytes)
getargspec)getfullargspecc                    | j                         j                         D cg c]  \  }}t        |      t        |      f }}}|j	                          | j                         }|s|st        | j                  | #         S |r|r|j                  d       d| j                  j                  ddj                  |      dj                  |D cg c]  }d|z  	 c}      z   dS c c}}w c c}w )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>
     < z%s=%s>)_repr_attrsitemsstrnormalize_reprsort_repr_wordssuper	__class____repr__append__name__join)selfkvalistwordsitms         Q/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/urwid/split_repr.py
split_reprr!      s    0 $$&,,.0Aq !fnQ'( 0E 0	JJLE T^^T355R(//51C'C-12	34 40 2s    C%C+c                 *   t        | t              rn| j                         D  cg c]  \  }} t        |      t        |       f }}} |j	                          ddj                  |D cg c]  }d|z  	 c}      z   dz   S t        |       S c c} }w c c}w )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'"
    {z, z%s: %s})
isinstancedictr   reprr   r   )r   r   r   r   s       r    r   r   B   s     !T01	:1$q'47#::

TYY&+ -"HsN - . .034 	4 7N ; -s    B
'B
c                 ~    t        |       }t        s+t        | t              rd|z   S |j	                  d      r|dd 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%   r   
startswith)r   rs     r    python3_reprr.   S   s?     	QAa7N<<QR5LH    c                 >   t         st        |      \  }}}}nt        |      \  }}}}}}}|r|d= |r|d= t        t	        t        |t        |      t        |      z
  d |                  }t	        | j                               D ]  }||v s||   | |   k(  s| |=  | 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)r   r   r   r&   listziplenkeys)	dfnargsvarargsvarkwdefaults_ddictr   s	            r    remove_defaultsr>   f   s    4 )3B&guh2@2D/guh1a HH c$s4y3x=89:HEFGE!&&(^ :Qx1Q4aD	 Hr/   c                  ,    dd l } | j                          y )Nr   )doctesttestmod)r@   s    r    _testrB      s    OOr/   __main__N)
__future__r   r   urwid.compatr   r   inspectr   r   r!   r   r.   r>   rB   r    r/   r    <module>rH      sE   , 0 '"&"4H"&.d Z	G r/   