Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
widget.cpython-313.pyc409 linesDownload Raw Back to __pycache__
1�

2��jFg���SSKJr SSKrSSKrSSKrSSKrSSKJr SSKJ	r	 SSK3JrJrJ
r
 SSKJr SSKJr SSKJr S	S4KJr \R,(aSSKJrJr \R4"S5r\R8"\5r"S
S\	R>\5r "SS\!5r""SS\#5r$Sr%Sr&Sr'Sr(Sr)"SS\ S9r*S$Sjr+S%Sjr,"SS\!5r-"SS \,"S!5\R\\5r/S"r0\S#:Xa\0"5 gg)&�)�annotationsN)�5attrgetter)�signals)�Canvas�CanvasCache�CompositeCanvas)�command_map��6split_repr)�	MetaSuper�)�Sizing)�Callable�Hashable�
WrappedWidgetc�,^�\rSrSrSrU4SjrSrU=r$)�7WidgetMeta�,a�8Bases: :class:`MetaSuper`, :class:`MetaSignals`9 10Automatic caching of render and rows methods.11 12Class variable *no_cache* is a list of names of methods to not cache13automatically.  Valid method names for *no_cache* are ``'render'`` and14``'rows'``.15 16Class variable *ignore_focus* if defined and set to ``True`` indicates17that the canvas this widget renders is not affected by the focus18parameter, so it may be ignored when caching.19c��>�URS/5n[TU]	XU5 SU;a#SU;a[U5nO[	U5nXPlSU;aSU;a[
U5UlSU;aU?SU;aU?	gg)N�no_cache�render�rows�ignore_focus)20�get�super�__init__�cache_widget_render�nocache_widget_renderr�cache_widget_rowsrrr)�cls�name�bases�dr�	render_fn�	__class__s      ��YD:\code\apps\devtools\python\user_packages\Python313\site-packages\urwid/widget/widget.pyr�WidgetMeta.__init__;s�����5�5��R�(��
����a�(��q�=��x�'�/��4�	�1�#�6�	�"�J��Q�;�6��1�(��-�C�H���?����Q��� ���)�__name__�21__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�
__classcell__�r%s@r&rr,s����!�!r(rc��\rSrSrSrSrg)�WidgetError�OzWidget specific errors.r)N�r*r+r,r-r.r/r)r(r&r3r3Os��!r(r3c��\rSrSrSrSrg)�
WidgetWarning�SzWidget specific warnings.r)Nr5r)r(r&r7r7Ss��#r(r7c��U(a USSS:waUSUR5:wd&[U5S:�aPUSUR5:wa8[SU<SUR5SSUR5SS	U<S223	5egg)z423Raise a WidgetError if a canv does not match size.24r
N)rr�Widget z rendered (r#z x z) canvas when passed size �!)�cols�lenrr3)�widget�size�canvs   r&�
validate_sizerAWs���	
��a�b��T�!�d�1�g�����&<�#�d�)�a�-�TX�YZ�T[�_c�_h�_h�_j�Tj���f�Z�{�4�9�9�;�q�/��T�Y�Y�[��O�Ke�fj�em�mn�o�25�	26�Uk�-r(c�^^^�[[TSS55mTRm[R"T5SUUU4Sjj5nTUlU$)zh27Return a function that wraps the cls.render() method28and fetches and stores canvases with CanvasCache.29rFc�>�U=(a T(+n[R"UTX5=n(aU$T"XUS9n[XU5 UR(a[	U5nURXU5 [R"TU5 U$�N)�focus)r�fetchrA�widget_infor�finalize�store��selfr?rEr@r �fnrs    ���r&�
cached_render�*cache_widget_render.<locals>.cached_renderis{����*�l�*���$�$�T�3��<�<�4�<��K��$�E�*���d�$�'����"�4�(�D��
�
�d�%�(����#�t�$��r(�F)�bool�getattrr�	functools�wraps�original_fn)r rMrLrs` @@r&rrasQ���30���^�U�;�<�L�	���B��_�_�R������!#�M���r(c�^�URm[TS5(aTRm[R"T5SU4Sjj5nTUlU$)z`31Return a function that wraps the cls.render() method32and finalizes the canvas that it returns.33rTc�>�T"XUS9nUR(a[U5n[XU5 URXU5 U$rD)rGrrArH)rKr?rEr@rLs    �r&�finalize_render�.nocache_widget_render.<locals>.finalize_render�s?����$�E�*�����"�4�(�D��d�$�'��
�
�d�%�(��r(rO)r�hasattrrTrRrS)r rWrLs  @r&rr|sO���3435
���B��r�=�!�!�
�^�^���_�_�R�����#%�O���r(c�^^�TRRm[R"T5SUU4Sjj5nTUlU$)z36Return a function that wraps the cls.render() method37and finalizes the canvas that it returns, but does not38cache the canvas.39c�r>�T"TXS9nUR(a[U5nURTX5 U$rD)rGrrH)r?rEr@rLrKs   ��r&rW�7nocache_widget_render_instance.<locals>.finalize_render�s5����$��*�����"�4�(�D��
�
�d�D�(��r(rO)rrTrRrS)rKrWrLs` @r&�nocache_widget_render_instancer]�s?���40���	 �	 �B��_�_�R�����#%�O���r(c�^^^�[[TSS55mTRm[R"T5SSUUU4Sjjj5nU$)zh41Return a function that wraps the cls.rows() method42and returns rows from the CanvasCache if available.43rFc�>�U=(a T(+n[R"UTX5=n(aUR5$T"XU5$�N)rrFrrJs    ���r&�cached_rows�&cache_widget_rows.<locals>.cached_rows�sC����*�l�*���$�$�T�3��<�<�4�<��9�9�;���$�e�$�$r(rO)r?z44tuple[int]rErP�return�int)rPrQrrRrS)r rarLrs` @@r&rr�sI���45���^�U�;�<�L�	���B��_�_�R��%�%��%��r(c�d�\rSrSrSrSr\"\R\R\R/5r\r
SSjrSSjrSSjrSSjrSSjrSSS	jjr\SS46j5r\SSj5rSS
jr\"\\SS9rSrS SjrS!SjrS"SjrS#SjrSS$SjjrSrg)%�Widget�ar47Widget base class48 49.. attribute:: _selectable50   :annotation: = False51 52   The default :meth:`.selectable` method returns this value.53 54.. attribute:: _sizing55   :annotation: = frozenset(['flow', 'box', 'fixed'])56 57   The default :meth:`.sizing` method returns this value.58 59.. attribute:: _command_map60   :annotation: = urwid.command_map61 62   A shared :class:`CommandMap` instance. May be redefined in subclasses or widget instances.63 64 65.. method:: rows(size, focus=False)66 67   .. note::68 69      This method is not implemented in :class:`.Widget` but70      must be implemented by any flow widget.  See :meth:`.sizing`.71 72   See :meth:`Widget.render` for parameter details.73 74   :returns: The number of rows required for this widget given a number of columns in *size*75 76   This is the method flow widgets use to communicate their size to other77   widgets without having to render a canvas. This should be a quick78   calculation as this function may be called a number of times in normal79   operation. If your implementation may take a long time you should add80   your own caching here.81 82   There is some metaclass magic defined in the :class:`Widget`83   metaclass :class:`WidgetMeta` that causes the84   result of this function to be retrieved from any85   canvas cached by :class:`CanvasCache`, so if your widget86   has been rendered you may not receive calls to this function. The class87   variable :attr:`ignore_focus` may be defined and set to ``True`` if this88   widget renders the same size regardless of the value of the *focus*89   parameter.90 91.. method:: get_cursor_coords(size)92 93   .. note::94 95      This method is not implemented in :class:`.Widget` but96      must be implemented by any widget that may return cursor97      coordinates as part of the canvas that :meth:`render` returns.98 99   :param size: See :meth:`Widget.render` for details.100   :type size: widget size101 102   :returns: (*col*, *row*) if this widget has a cursor, ``None`` otherwise103 104   Return the cursor coordinates (*col*, *row*) of a cursor that will appear105   as part of the canvas rendered by this widget when in focus, or ``None``106   if no cursor is displayed.107 108   The :class:`ListBox` widget109   uses this method to make sure a cursor in the focus widget is not scrolled out of view.110   It is a separate method to avoid having to render the whole widget while calculating layout.111 112   Container widgets will typically call the :meth:`.get_cursor_coords` method on their focus widget.113 114 115.. method:: get_pref_col(size)116 117   .. note::118 119      This method is not implemented in :class:`.Widget` but may be implemented by a subclass.120 121   :param size: See :meth:`Widget.render` for details.122   :type size: widget size123 124   :returns: a column number or ``'left'`` for the leftmost available125             column or ``'right'`` for the rightmost available column126 127   Return the preferred column for the cursor to be displayed in this128   widget. This value might not be the same as the column returned from129   :meth:`get_cursor_coords`.130 131   The :class:`ListBox` and :class:`Pile`132   widgets call this method on a widget losing focus and use the value133   returned to call :meth:`.move_cursor_to_coords` on the widget becoming134   the focus. This allows the focus to move up and down through widgets135   while keeping the cursor in approximately the same column on screen.136 137 138.. method:: move_cursor_to_coords(size, col, row)139 140   .. note::141 142      This method is not implemented in :class:`.Widget` but may be implemented by a subclass.143      Not implementing this method is equivalent to having a method that always returns144      ``False``.145 146   :param size: See :meth:`Widget.render` for details.147   :type size: widget size148   :param col: new column for the cursor, 0 is the left edge of this widget149   :type col: int150   :param row: new row for the cursor, 0 it the top row of this widget151   :type row: int152 153   :returns: ``True`` if the position was set successfully anywhere on *row*, ``False`` otherwise154Fc��[R"URRSURR35Ulg)N�.)�logging�	getLoggerr%r+r*�logger�rKs r&r�Widget.__init__-s5���'�'�4�>�>�+D�+D�*E�Q�t�~�~�G^�G^�F_�(`�a��r(c�0�[R"U5 g)zZMark cached canvases rendered by this widget as dirty so that they will not be used again.N)r�155invalidaterms r&�_invalidate�Widget._invalidate0s�����t�$r(c�4�[R"XU/UQ76 g)zAConvenience function to emit signals with self as first argument.N)r�emit_signal)rKr!�argss   r&�_emit�Widget._emit4s�����D��4�t�4r(c��UR$)a�156:returns: ``True`` if this is a widget that is designed to take the157          focus, i.e. it contains something the user might want to158          interact with, ``False`` otherwise,159 160This default implementation returns :attr:`._selectable`.161Subclasses may leave these is if the are not selectable,162or if they are always selectable they may163set the :attr:`_selectable` class variable to ``True``.164 165If this method returns ``True`` then the :meth:`.keypress` method166must be implemented.167 168Returning ``False`` does not guarantee that this widget will never be in169focus, only that this widget will usually be skipped over when changing170focus. It is still possible for non selectable widgets to have the focus171(typically when there are no other selectable widgets visible).172)�_selectablerms r&�173selectable�Widget.selectable8s��&���r(c��UR$)a{174:returns: A frozenset including one or more of ``'box'``, ``'flow'`` and175          ``'fixed'``.  Default implementation returns the value of176          :attr:`._sizing`, which for this class includes all three.177 178The sizing modes returned indicate the modes that may be179supported by this widget, but is not sufficient to know180that using that sizing mode will work.  Subclasses should181make an effort to remove sizing modes they know will not182work given the state of the widget, but many do not yet183do this.184 185If a sizing mode is missing from the set then the widget186should fail when used in that mode.187 188If ``'flow'`` is among the values returned then the other189methods in this widget must be able to accept a190single-element tuple (*maxcol*,) to their ``size``191parameter, and the :meth:`rows` method must be defined.192 193If ``'box'`` is among the values returned then the other194methods must be able to accept a two-element tuple195(*maxcol*, *maxrow*) to their size parameter.196 197If ``'fixed'`` is among the values returned then the other198methods must be able to accept an empty tuple () to199their size parameter, and the :meth:`pack` method must200be defined.201)�_sizingrms r&�sizing�
Widget.sizingMs��<�|�|�r(c�@�U(d@[RUR5;a[U<S35e[	SU<35e[U5S:XaG[RUR5;a/UQURX5P7$[	SU<35eU$)a�202See :meth:`Widget.render` for parameter details.203 204:returns: A "packed" size (*maxcol*, *maxrow*) for this widget205 206Calculate and return a minimum207size where all content could still be displayed. Fixed widgets must208implement this method and return their size when ``()`` is passed as the209*size* parameter.210 211This default implementation returns the *size* passed, or the *maxcol*212passed and the value of :meth:`rows` as the *maxrow* when (*maxcol*,)213is passed as the *size* parameter.214 215.. note::216 217   This is a new method that hasn't been fully implemented across the218   standard widget types. In particular it has not yet been219   implemented for container widgets.220 221:class:`Text` widgets have implemented this method.222You can use :meth:`Text.pack` to calculate the minimum223columns and rows required to display a text widget without wrapping,224or call it iteratively to calculate the minimum number of columns225required to display the text wrapped into a target number of rows.226z must override Widget.pack()z1Cannot pack () size, this is not a fixed widget: r
z7Cannot pack (maxcol,) size, this is not a flow widget: )r�FIXEDr~�NotImplementedErrorr3r=�FLOWr�rKr?rEs   r&�pack�Widget.packms���6��|�|�t�{�{�}�,�)�T�H�4P�*Q�R�R�� Q�RV�QY�Z�[�[��t�9��>��{�{�d�k�k�m�+�6��6�t�y�y��5�6�6�� W�X\�W_�`�a�a��r(c��U$)z�Read-only property that steps through decoration widgets and returns the one at the base.227 228This default implementation returns self.229r)rms r&�base_widget�Widget.base_widget�s	���r(c��g)z�230Read-only property returning the child widget in focus for container widgets.231 232This default implementation always returns ``None``, indicating that this widget has no children.233Nr)rms r&rE�Widget.focus�s��r(Nc�"�[SU<S35e)NzNo focus_position, z is not a container widget)�234IndexError)rK�vals  r&�_not_a_container�Widget._not_a_container�s���.�t�h�6P�Q�R�Rr(a235        Property for reading and setting the focus position for236        container widgets. This default implementation raises237        :exc:`IndexError`, making normal widgets fail the same way238        accessing :attr:`.focus_position` on an empty container widget would.239        )�docc��[U5$)zqA friendly __repr__ for widgets.240 241Designed to be extended by subclasses with _repr_words and _repr_attr methods.242r243rms r&�__repr__�Widget.__repr__�s��244�$��r(c�r�/nUR5(aS/UQnUR5(a�UR5[[R[R245[R/5:wa7URSR[UR5555 /UQSP$)Nrz�/r>)246rzr~�	frozensetrr��BOXr��append�join�sorted)rK�wordss  r&�_repr_words�Widget._repr_words�s������?�?���!�*�E�*�E��;�;�=�=�T�[�[�]�i����f�j�j�RX�R^�R^�8_�.`�`��L�L����&�����"7�8�9�!��!��!�!r(c��0$r`r)rms r&�_repr_attrs�Widget._repr_attrs�s���	r(c�,�UR5(d~[US5(a!URRSU<35 U$[R247"SURRS3[SS9 [RSU<S35 U$)aDKeyboard input handler.248 249:param size: See :meth:`Widget.render` for details250:type size: tuple[()] | tuple[int] | tuple[int, int]251:param key: a single keystroke value; see :ref:`keyboard-input`252:type key: str253:return: ``None`` if *key* was handled by *key* (the same value passed) if *key* was not handled254:rtype: str | None255rlz'keypress sent to non selectable widget r:z! did not call 'super().__init__()���256stacklevel� is not selectable�257rzrYrl�debug�warnings�warnr%r*r7�LOGGER)rKr?�keys   r&�keypress�Widget.keypress�s������ � ��t�X�&�&����!�!�$K�D�8�"T�U��258�
�
�
��d�n�n�5�5�6�6W�X�!� ��259���w�t�h�.@�A�B��260r(c�*�UR5(d~[US5(a!URRSU<S35 g[R261"SURRS3[SS9 [RSU<S35 g)aEMouse event handler.262 263:param size: See :meth:`Widget.render` for details.264:type size: tuple[()] | tuple[int] | tuple[int, int]265:param event: Values such as ``'mouse press'``, ``'ctrl mouse press'``,266             ``'mouse release'``, ``'meta mouse release'``,267             ``'mouse drag'``; see :ref:`mouse-input`268:type event: str269:param button: 1 through 5 for press events, often 0 for release events270              (which button was released is often not known)271:type button: int272:param col: Column of the event, 0 is the left edge of this widget273:type col: int274:param row: Row of the event, 0 it the top row of this widget275:type row: int276:param focus: Set to ``True`` if this widget or one of its children is in focus277:type focus: bool278:return: ``True`` if the event was handled by this widget, ``False`` otherwise279:rtype: bool | None280rlr:r�z not called 'super().__init__()r�r�Fr�)rKr?�event�button�col�rowrEs       r&�mouse_event�Widget.mouse_event�s���:��� � ��t�X�&�&����!�!�G�D�8�3E�"F�G��
�
�
��d�n�n�5�5�6�6U�V�!� ��281���w�t�h�.@�A�B�r(c��[e)apRender widget and produce canvas282 283:param size: One of the following, *maxcol* and *maxrow* are integers > 0:284 285    (*maxcol*, *maxrow*)286      for box sizing -- the parent chooses the exact287      size of this widget288 289    (*maxcol*,)290      for flow sizing -- the parent chooses only the291      number of columns for this widget292 293    ()294      for fixed sizing -- this widget is a fixed size295      which can't be adjusted by the parent296:type size: widget size297:param focus: set to ``True`` if this widget or one of its children is in focus298:type focus: bool299 300:returns: A :class:`Canvas` subclass instance containing the rendered content of this widget301 302:class:`Text` widgets return a :class:`TextCanvas` (arbitrary text and display attributes),303:class:`SolidFill` widgets return a :class:`SolidCanvas` (a single character repeated across the whole surface)304and container widgets return a :class:`CompositeCanvas` (one or more other canvases arranged arbitrarily).305 306If *focus* is ``False``, the returned canvas may not have a cursor position set.307 308There is some metaclass magic defined in the :class:`Widget` metaclass :class:`WidgetMeta`309that causes the result of this method to be cached by :class:`CanvasCache`.310Later calls will automatically look up the value in the cache first.311 312As a small optimization the class variable :attr:`ignore_focus`313may be defined and set to ``True`` if this widget renders the same314canvas regardless of the value of the *focus* parameter.315 316Any time the content of a widget changes it should call317:meth:`_invalidate` to remove any cached canvases, or the widget318may render the cached canvas instead of creating a new one.319)r�r�s   r&r�
Widget.render	s��X"�!r()rl)rc�None)r!rrcr�)rcrP)rczfrozenset[Sizing]rO)r?�(tuple[()] | tuple[int] | tuple[int, int]rErPrcztuple[int, int])rcrf)rcz
Widget | Noner`)rcz	list[str])rczdict[str, typing.Any]�r?r�r��strrcz320str | None)r?r�r�r�r�rdr�rdr�rdrErPrczbool | None)r?r�rErPrcr) r*r+r,r-r.ryr�rr�r�r�r}r	�_command_maprrqrvrzr~r��propertyr�rEr��focus_positionr�r�r�r�r�rr/r)r(r&rfrf�s=��l�\�K�����f�j�j�&�,�,�?�@�G��L�b�%�5� �*�@&�P��������S����
�	�N� �"���6����321�	�4'�6�'��'��	'�322�'��
'��'�323�'�X�,"�6�,"��,"�324�	,"�,"r(rf)�	metaclassc�0�U(a[SU<35eg)zO325raise ValueError if size != ().326 327Used by FixedWidgets to test size parameter.328z+FixedWidget takes only () for size.passed: N)�329ValueError)r?s r&�330fixed_sizer�8s����F�t�h�O�P�P�r(c�B^�[U5m"U4SjS[5nU$)z�331Return a mixin class that delegates all standard widget methods332to an attribute given by attribute_name.333 334This mixin is designed to be used as a superclass of another widget.335c� >�\rSrSr%S/rS\S'SSU4Sjjjr\SU4Sjj5r\SU4Sjj5r	\SU4Sjj5r336SU4S	jjr\SU4S337jj5r\SU4Sjj5r
\SU4Sjj5r\SU4S
jj5r\SU4Sjj5rSrg)�7delegate_to_widget_mixin.<locals>.DelegateToWidgetMixiniNrztyping.ClassVar[list[str]]rc�D>�T"U5RXS9n[U5$rD)rr)rKr?rEr@�get_delegates    �r&r�>delegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.renderQs&�����%�,�,�T�,�?�D�"�4�(�(r(c�(>�T"U5R$r`)rz�rKr�s �r&rz�Bdelegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.selectableUs�����%�0�0�0r(c�(>�T"U5R$r`)�get_cursor_coordsr�s �r&r��Idelegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.get_cursor_coordsYs��� ��%�7�7�7r(c�(>�T"U5R$r`)�get_pref_colr�s �r&r��Ddelegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.get_pref_col^s��� ��%�2�2�2r(c�2>�T"U5RX5$r`)r�)rKr?r�r�s   �r&r��@delegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.keypresscs�����%�.�.�t�9�9r(c�(>�T"U5R$r`)�move_cursor_to_coordsr�s �r&r��Mdelegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.move_cursor_to_coordsfs��� ��%�;�;�;r(c�(>�T"U5R$r`)rr�s �r&r�<delegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.rowsk������%�*�*�*r(c�(>�T"U5R$r`)r�r�s �r&r��Cdelegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.mouse_eventos���338 ��%�1�1�1r(c�(>�T"U5R$r`)r~r�s �r&r~�>delegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.sizingvs�����%�,�,�,r(c�(>�T"U5R$r`)r�r�s �r&r��<delegate_to_widget_mixin.<locals>.DelegateToWidgetMixin.packzr�r(r)NrO)rErPrcr)rczCallable[[], bool])rczLCallable[[tuple[()] | tuple[int] | tuple[int, int]], tuple[int, int] | None])rcz@Callable[[tuple[()] | tuple[int] | tuple[int, int]], int | None]r�)rczFCallable[[[tuple[()] | tuple[int] | tuple[int, int], int, int]], bool])rcz!Callable[[tuple[int], bool], int])rcz[Callable[[tuple[()] | tuple[int] | tuple[int, int], str, int, int, int, bool], bool | None])rczCallable[[], frozenset[Sizing]])rczKCallable[[tuple[()] | tuple[int] | tuple[int, int], bool], tuple[int, int]])r*r+r,r-r�__annotations__rr�rzr�r�r�r�rr�r~r�r/)r�s�r&�DelegateToWidgetMixinr�Ns����06�x��,�7�	)�	)�339�	1�340�	1�341�	8�342�	8�343�	3�344�	3�	:�345�	<�346�	<�347�	+�348�	+�349�	2�
h�	2�350�	2�351�	-�352�	-�353�	+�354�	+r(r�)rrf)�attribute_namer�r�s  @r&�delegate_to_widget_mixinr�Bs$����n�-�L�.+��.+�`!� r(c��\rSrSrSrg)�WidgetWrapErrori�r)N)r*r+r,r-r/r)r(r&r�r��s��r(r�c�r^�\rSrSrSU4Sjjr\SSj5r\RS	Sj5rSSjrSr	U=r355$)356�357WidgetWrapi�c��>�[TU]5 [U[5(dLURR358SURR3n[R"US3[SS9 Xl359g)a�360w -- widget to wrap, stored as self._w361 362This object will pass the functions defined in Widget interface363definition to self._w.364 365The purpose of this widget is to provide a base class for366widgets that compose other widgets for their display and367behaviour.  The details of that composition should not affect368users of the subclass.  The subclass may decide to expose some369of the wrapped widgets by behaving like a ContainerWidget or370WidgetDecoration, or it may hide them from outside access.371riz is not subclass of Widget�r�N)rr�372isinstancerfr%r+r*r�r��DeprecationWarning�_wrapped_widget)rK�w�obj_class_pathr%s   �r&r�WidgetWrap.__init__�si���	�����!�V�$�$� !��� 6� 6�7�q����9M�9M�8N�O�N��M�M�!�"�"<�=�"��
�373 !�r(c��UR$r`�r�rms r&�_w�
WidgetWrap._w�s���#�#�#r(c�0�XlUR5 g)aW374Change the wrapped widget.  This is meant to be called375only by subclasses.376 377>>> size = (10,)378>>> ww = WidgetWrap(Edit("hello? ", "hi"))379>>> ww.render(size).text  # ... = b in Python 3380[...'hello? hi ']381>>> ww.selectable()382True383>>> ww._w = Text("goodbye")  # calls _set_w()384>>> ww.render(size).text385[...'goodbye   ']386>>> ww.selectable()387False388N)r�rq)rK�389new_widgets  r&r�r��s��$ *�����r(c�d�[R"S[SS9 XlUR	5 g)aw390Change the wrapped widget.  This is meant to be called391only by subclasses.392>>> from urwid import Edit, Text393>>> size = (10,)394>>> ww = WidgetWrap(Edit("hello? ", "hi"))395>>> ww.render(size).text  # ... = b in Python 3396[...'hello? hi ']397>>> ww.selectable()398True399>>> ww._w = Text("goodbye")  # calls _set_w()400>>> ww.render(size).text401[...'goodbye   ']402>>> ww.selectable()403False404zg_set_w is deprecated. Please use 'WidgetWrap._w' property directly. API will be removed in version 5.0.r�r�N)r�r�r�r�rq)rKr�s  r&�_set_w�WidgetWrap._set_w�s-��"	�
�
�u���	405�406 !�����r(r�)r�rrcr�)rcr)r�rrcr�)r*r+r,r-rr�r��setterr�r/r0r1s@r&r�r��s>���!�0�$��$��Y�Y����(�r(r�r�c�,�SSKnUR5 g)Nr)�doctest�testmod)r�s r&�_testr��s����O�O�r(�__main__)r?z	tuple[()]rcr�)r�r�rcztype[Widget])1�407__future__rrRrj�typingr��operatorr�urwidr�urwid.canvasrrr�urwid.command_mapr	�urwid.split_reprr�408urwid.utilr�	constantsr�
TYPE_CHECKING�collections.abcrr�TypeVarrrkr*r��MetaSignalsr�	Exceptionr3�Warningr7rArrr]rrfr�r�r��Genericr�r�r)r(r&�<module>rs���*#���
����=�=�)�'� ��	���2�����/�
�	�	�	�8�	$�� !��$�$�i� !�F"�)�"�$�G�$�409��6�,�(�({"�z�{"�|Q�<!�~	�i�	�I�)�*;�<�f�n�n�]�>[�I�X��z��	�G�r(
codekingpro/portable-devtools · Team Ai