Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
line_box.cpython-313.pyc103 linesDownload Raw Back to __pycache__
1�

2��j���SSKJr SSKrSSKJr SSKJrJrJr SSK	J3r4 SSKJr SSK
Jr SS	KJr SS5KJrJr \R((aSSKJr SSKJr \R2"S
5r"SS\\\"S55rg)�)�annotationsN�)�Columns)�BOX_SYMBOLS�Align�6WHSettings)�Divider)�Pile)�	SolidFill)�Text)�WidgetDecoration�delegate_to_widget_mixin)�Literal)�Widget�
WrappedWidgetc�J^�\rSrSr\rS\RS\RR\RR\RR\RR\RR\RR\RR\RR4SU4Sjjjr\S
U4Sjj5r\R$SSj5r\SSj5rSSjrSS	jr\SS7j5rSrU=r$)�LineBox��Nc
8��>�[U5n
[U95n[U5[U5[U5nnn[U	5[U5[U5nnnU(dU(a[S5eU(a![X@R	U545UlO[UR	U55UlU(GaU[R[R[R1;a[S5eU[R:Xa[RUR104U/nOCU[RUR114/nU[R:XaURU5 [U5Ul[[[!U=(a U55U4UR[[!U=(a U1255U445nO	SUlSn[[[!U55U
4U[[!U1355U44SS/US9nU(aI[[[!U	=(a U55U4U[[!U=(a U1455U445nOSn/nU(a!UR[RU45 URU5 U(a!UR[RU45 [#UUS9Ul[&TU]QU5 g)uO15Draw a line around original_widget.16 17Use 'title' to set an initial title text with will be centered18on top of the box.19 20Use `title_attr` to apply a specific attribute to the title text.21 22Use `title_align` to align the title to the 'left', 'right', or 'center'.23The default is 'center'.24 25You can also override the widgets used for the lines/corners:26    tline: top line27    bline: bottom line28    lline: left line29    rline: right line30    tlcorner: top left corner31    trcorner: top right corner32    blcorner: bottom left corner33    brcorner: bottom right corner34 35If empty string is specified for one of the lines/corners, then no character will be output there.36If no top/bottom/left/right lines - whole lines will be omitted.37This allows for seamless use of adjoining LineBoxes.38 39Class attribute `Symbols` can be used as source for standard lines:40 41>>> print(LineBox(Text("Some text")).render(()))42┌─────────┐43│Some text│44└─────────┘45>>> print(46...     LineBox(47...         Text("Some text"),48...         tlcorner=LineBox.Symbols.LIGHT.TOP_LEFT_ROUNDED,49...         trcorner=LineBox.Symbols.LIGHT.TOP_RIGHT_ROUNDED,50...         blcorner=LineBox.Symbols.LIGHT.BOTTOM_LEFT_ROUNDED,51...         brcorner=LineBox.Symbols.LIGHT.BOTTOM_RIGHT_ROUNDED,52...     ).render(())53... )54╭─────────╮55│Some text│56╰─────────╯57>>> print(58...     LineBox(59...         Text("Some text"),60...         tline=LineBox.Symbols.HEAVY.HORIZONTAL,61...         bline=LineBox.Symbols.HEAVY.HORIZONTAL,62...         lline=LineBox.Symbols.HEAVY.VERTICAL,63...         rline=LineBox.Symbols.HEAVY.VERTICAL,64...         tlcorner=LineBox.Symbols.HEAVY.TOP_LEFT,65...         trcorner=LineBox.Symbols.HEAVY.TOP_RIGHT,66...         blcorner=LineBox.Symbols.HEAVY.BOTTOM_LEFT,67...         brcorner=LineBox.Symbols.HEAVY.BOTTOM_RIGHT,68...     ).render(())69... )70┏━━━━━━━━━┓71┃Some text┃72┗━━━━━━━━━┛73 74To make Table constructions, some lineboxes need to be drawn without sides75and T or CROSS symbols used for corners of cells.76z.Cannot have a title when tline is empty stringz7title_align must be one of "left", "right", or "center"Nr�)�box_columns�focus_column)�77focus_item)rrr	�78ValueError�format_title�title_widgetr�LEFT�CENTER�RIGHTr�PACK�appendr�tline_widget�int�boolr79�_wrapped_widget�super�__init__)�self�original_widget�title�title_align�80title_attr�tlcorner�tline�lline�trcorner�blcorner�rline�bline�brcorner�w_lline�w_rline�81w_tlcorner�w_tline�82w_trcorner�83w_blcorner�w_bline�84w_brcorner�
tline_widgets�top�middle�bottom�pile_widgets�	__class__s                          ��[D:\code\apps\devtools\python\user_packages\Python313\site-packages\urwid/widget/line_box.pyr(�LineBox.__init__sb���^�E�"���E�"��*.�x�.�'�%�.�$�x�.�Z�G�85�*.�x�.�'�%�.�$�x�.�Z�G�86����M�N�N�� $�j�2C�2C�E�2J�%K� L�D�� $�T�%6�%6�u�%=� >�D����5�:�:�u�|�|�U�[�[�"I�I� �!Z�[�[��e�j�j�(�",�/�/�4�3D�3D�!E�w� O�
�!(�:�?�?�D�<M�<M�*N� O�
��%�,�,�.�!�(�(��1� '�
� 6�D�����h�0�5�1�2�J�?��%�%���h�0�5�1�2�J�?���C�!%�D���C���$�u�+���
(�/�C��U��<L�g�;V�W��A��(�87������h�0�5�1�2�J�?����h�0�5�1�2�J�?���F��F����������#� 6�7����F�#��������&� 9�:�#�L�V�D���
����)�c�>�[TU]$�N)r'r*)r)rCs �rDr*�LineBox.original_widget�s����w�&�&rFc��[[UR55nSn[R"SUR88U5nURUupVX4URU'[RRX5 g)Nrr)89r$r%r#�typing�castr&�contentsr
r*�fset)r)r*�v_index�h_indexr@�_old_widget�optionss       rDr*rI�sm���d�4�,�,�-�.���� �+�+�i��1E�1E�g�1N�O��%���w�7���$3�#=����� ��(�(�-�-�d�DrFc��UR$rH)r&�r)s rD�_w�90LineBox._w�s���#�#�#rFc��U(aSUS3$g)N� r��r)�texts  rDr�LineBox.format_title�s����t�f�A�;��rFc���UR(d[S5eURRUR	U55 URR5 g)Nz$Cannot set title when tline is unset)r#rr�set_textr�_invalidaterZs  rD�	set_title�LineBox.set_title�sH��� � ��C�D�D����"�"�4�#4�#4�T�#:�;����%�%�'rFc�.�URR$)z�LineBox is partially container.91 92While focus position is a bit hacky93(formally it's not container and only position 0 available),94focus widget is always provided by original widget.95)�_original_widget�focusrTs rDrd�
LineBox.focus�s���$�$�*�*�*rF)r&rr#)r*rr+�strr,z*Literal['left', 'center', 'right'] | Alignr.rfr/rfr0rfr1rfr2rfr3rfr4rfr5rf�return�None)rgr)r*rrgrh)rgr96)r[rfrgrf)r[rfrgrh)rgz
Widget | None)�__name__�97__module__�__qualname__�__firstlineno__r�Symbolsrr�LIGHT�TOP_LEFT�98HORIZONTAL�VERTICAL�	TOP_RIGHT�BOTTOM_LEFT�BOTTOM_RIGHTr(�propertyr*�setterrUrr`rd�__static_attributes__�
__classcell__)rCs@rDrrs�����G�99�BG�,�,��#�)�)�2�2� �&�&�1�1� �&�&�/�/�#�)�)�3�3�#�)�)�5�5� �&�&�/�/� �&�&�1�1�#�)�)�6�6�P*�&�P*��P*�@�	P*��
P*��P*��P*��P*��P*��P*��P*��P*�100�P*�P*�d�'��'����E��E��$��$��(��+��+rFrr&)�101__future__rrK�columnsr�	constantsrrr�dividerr	�piler102�103solid_fillrr[r�widget_decorationr
r�
TYPE_CHECKING�typing_extensionsr�widgetr�TypeVarrrrYrFrD�<module>r�s]��"�
��5�5���!��I�	���)������/�
�z+��}�-�/G�HY�/Z�z+rF
codekingpro/portable-devtools · Team Ai