grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a BjŒjÀã@sxddlmZmZddlmZmZes2ddlmZn ddlmZdd„Z dd„Z d d „Z d d „Z d d„Z edkrte ƒdS)é)ÚdivisionÚprint_function)ÚPYTHON3Úbytes)Ú getargspec)ÚgetfullargspeccCszdd„| ¡ ¡Dƒ}| ¡| ¡}|s>|s>t|j|ƒ ¡S|rP|rP| 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() >>> 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() cSs g|]\}}t|ƒt|ƒf‘qS©)ÚstrÚnormalize_repr©Ú.0ÚkÚvrrú6/usr/lib64/python3.9/site-packages/urwid/split_repr.pyÚ 4sÿzsplit_repr..Úz<%s %s>ú cSsg|] }d|‘qS)z%s=%sr©r Zitmrrrr?ó) Z _repr_attrsÚitemsÚsortZ _repr_wordsÚsuperÚ __class__Ú__repr__ÚappendÚ__name__Újoin)ÚselfZalistÚwordsrrrÚ split_reprs ÿÿÿrcCsHt|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)Úreprr rrrrKrz"normalize_repr..ú{z, cSsg|] }d|‘qS)z%s: %srrrrrrMsú})Ú isinstanceÚdictrrrr )rrrrrr As  ÿÿr cCs8t|ƒ}ts4t|tƒrd|S| d¡r4|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_reprRs    r*c Csštst|ƒ\}}}}nt|ƒ\}}}}}}}|r6|d=|r@|d=ttt|t|ƒt|ƒd…|ƒƒƒ}t| ¡ƒD]"}||vrr||||krr||=qr|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(10, 2) >>> Foo() éÿÿÿÿN)rrrr$ÚlistÚzipÚlenÚkeys) ÚdÚfnÚargsZvarargsZvarkwÚdefaultsÚ_Zddictr rrrÚremove_defaultses&r5cCsddl}| ¡dS)Nr)ÚdoctestZtestmod)r6rrrÚ_test—sr7Ú__main__N)Z __future__rrZ urwid.compatrrÚinspectrrrr r*r5r7rrrrrÚs $2