403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python315/Lib/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/idlelib/__pycache__/format.cpython-315.pyc
R
>lqjK?c�*�Qs]PHs]QHGs]QHGs]QHGsQQ2s\O2Qs
QsQsQ	s
Q
sQs\O Q2sQ
sQQ2sQQ2sQQ2s\Q6Xc]QH\Gs\Q]P
Q5P!P!)z�Format all or a selected region (line slice) of text.

Region formatting options: paragraph, comment block, indent, deindent,
comment, uncomment, tabify, and untabify.

File renamed from paragraph.py with functions added from editor.py.
)�askyesno)�
askinteger)�idleConfc�L`�\sQs]snQsQs\Q2sQsQQks	Qs
UsP!)�FormatParagrapha�Format a paragraph, comment block, or selection to a max width.

Does basic, standard text formatting, and also understands Python
comment blocks. Thus, for editing Python source code, this
extension is really only suitable for reformatting these comment
blocks or triple-quoted strings.

Known problems with comment reformatting:
* If there is a selection marked, and the first line of the
  selection is not complete, the block will probably not be detected
  as comments, and will have the normal "text formatting" rules
  applied.
* If a comment block has leading whitespace that mixes tabs and
  spaces, they will not be considered part of the same block.
* Fancy comments, like this bulleted list, aren't handled :-)
c��VmP!�N��editwin��selfr	s&&�#C:\Python315\\Lib\idlelib\format.py�__init__�FormatParagraph.__init__�����c�H�[OQQQQ]HQ5UmP!)�
extensionsrz	max-width�int)�type�default)r�	GetOption�	max_width)�clss&r�reload�FormatParagraph.reload"s!�� �*�*�<�9J�+6�U�B�P��
rc��PUmP!rr�rs&r�close�FormatParagraph.close's	����rc��Ue
UOLSoUOOoUOO2vqEU%c&U%cUO	VE2o[U2oL[
V3OQ22vqEqvU%c[VbU2oL[Vb2oUOQQQ2V�6wcVUOQU2UO2UOVE2UOVH2UO2LUOQU2UO!Q2Q!)a�Formats paragraph to a max width specified in idleConf.

If text is selected, format_paragraph_event will start breaking lines
at the max width, starting from the beginning selection.

If no text is selected, format_paragraph_event uses the current
cursor location to determine the paragraph (lines of text surrounded
by blank lines) and formats it.

The length limit parameter is for testing with a known value.
�insert�sel�1.0�end�break)rr	�text�get_selection_indices�get�get_comment_header�find_paragraph�index�reformat_comment�reformat_paragraph�
tag_remove�mark_set�undo_block_start�deleter �undo_block_stop�see)	r�event�limitr%�first�last�data�comment_header�newdatas	&&&      r�format_paragraph_event�&FormatParagraph.format_paragraph_event*s���#(�-����U���|�|� � ���l�l�8�8�:����T��8�8�E�(�D�/��5�N�#�4���H�)=�>�
.�E���&�t�N�C�G�(��5�G�����u�e�,��?��M�M�(�E�*��!�!�#��K�K��$��K�K��'�� � �"��M�M�(�D�)������rrr)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r
�classmethodrrr:�__static_attributes__�__classdictcell__��
__classdict__s@rrrs4����� ��P��P��$�$rrc�^�[[UOQ22vq#UOQU*QU*2oUO	QU*QQ2%c=[U2%c,U]*oUOQU*QU*2oJ\So[
U2o[U2o[
U2U6Xc?[VGP2%f,U]*oUOQU*QU*2oJNQU*oU]*
oUOQU*QU*2oU]6�cO[
U2U6Xc?[VGP2%f,U]*
oUOQU*QU*2oJUQU]**o	V�V`OV�21!)z�Returns the start/stop indices enclosing the paragraph that mark is in.

Also returns the comment format string, if any, and paragraph of text
between the start/stop indices.
�.z%d.0z%d.end�<r#)�mapr�splitr'�compare�is_all_whiter(�len)
r%�mark�lineno�col�line�first_linenor8�comment_header_lenr6r5s
&&        rr)r)Ssk���c�4�:�:�c�?�+�K�F��8�8�F�V�O�X��%6�7�D��,�,�v����U�
3�
3��T�8J�8J��!����x�x�����F�):�;���L�'��-�N��^�,���T�
"�N�
2��t�$7�8�9�9��!����x�x�����F�):�;���F�?�D��A�
�F��8�8�F�V�O�X��%6�7�D�
�1�*� ��&��6��t�$7�8�9�9��!����x�x�����F�):�;���f�Q�h��E������(=�=�=rc��UOQ2o]o[U2oV46c#[V#*2%cU]*oJ(V46�cU![V#*2oU]*U6c8[V#]**2%f[V#]**2oLSoUPUoSoV46Cc[V#*2%f�[OQV#*2o	[][U	2]2FD�o
V�*oU%fJ[V�*O
22U6�c(V�6wc"UOUO22SoV�*Q*oU
]*[U	26fJ�V�]**Q6wfJ�UQ*oJ�	U]*oCJ	UOUO22UOV#P2QOU2!)z3Return data reformatted to specified width (limit).�
z(\s+)� )rJrMrL�
get_indent�re�range�
expandtabs�append�rstrip�extend�join)r7r4�lines�i�n�indent1�indent2�new�partial�words�j�words&&          rr,r,xsy���J�J�t��E�	�A��E�
�A�
�%�L���*�*�
�a�C���v������"�G���s�Q�w�|�E�A�#�J�/�/��U�Q�3�Z�(����
���)�C��G�
�%��U�X�.�.�����5�8�,���q�#�e�*�a�(�A��8�D����G�N�.�.�0�1�E�9��%��
�
�7�>�>�+�,�!���n�s�*�G���s�S��Z��E�A�#�J�#�$5�!�C�-��)�
�a�C���J�J�w�~�~�� ��J�J�u�R�y���9�9�S�>�rc�R``�[R2nQOU1QkUOQ222o[U[R2*
]2o[	V2oUOQ2oPoUP*%fQoUPPoQOU1QkU22U*!)z?Return data reformatted to specified width with comment header.rUc3�8:�SF �D
pRPw�	J	P!3hr�)�.0rQ�lcs& �r�	<genexpr>�#reformat_comment.<locals>.<genexpr>�s��+;���+;�4�"�#�Y�+;�s�c3�B:�SF �DoRU*w�	J	P!3hrrk)rlrQr8s& �rrnro�s��W���W�T�^�D�(�(�W�s�)rMr^rJ�maxr,)r7r4r8�format_widthr9�block_suffixrms&&f   @rr+r+�s����

�^�	�B��9�9�<�4�:�:�d�+;�<�<�D��u�s�>�2�2�B�7�L� ��4�G��m�m�D�!�G�
�L��2�;�;����#�2�,���9�9�=�W�=�=��L�Lrc�6�[OQU2PI!)z/Return True if line is empty or all whitespace.z^\s*$)rX�match�rQs&rrLrL�s���8�8�H�d�#�4�/�/rc�N�[OQU2O2!)z/Return the initial space or tab indent of line.z	^([ \t]*)�rXru�grouprvs&rrWrW�s��
�8�8�L�$�'�-�-�/�/rc�`�[OQU2oUeP!UO]2!)z�Return string with leading whitespace and '#' from line or ''.

A null return indicates that the line is not a comment line. A non-
null return, such as '    #', will be used to find the other lines of
a comment block with the same  indent.
z^([ \t]*#*)rx)rQ�ms& rr(r(�s)��	�����&�A��y���7�7�1�:�rz[ \t]*c��[OU2oUO2[UO	2OU221!)z�Return a line's indentation as (# chars, effective # of spaces).

The effective # of spaces is the length after properly "expanding"
the tabs into spaces, as done by str.expandtabs(tabwidth).
)�_line_indent_rerur#rMryrZ)rQ�tabwidthr{s&& r�get_line_indentr�s;��	���d�#�A��5�5�7�C����	�,�,�X�6�7�7�7rc�z`�\sQs]�snQsQsQsQsQ
QksQ
Qks	Q
Qks
Q
QksQ
Q	ksQ
Q
ks
QsQsUsP!)�FormatRegionzFormat selected text (region).c��VmP!rrr
s&&rr
�FormatRegion.__init__�rrc�z�UOOoUOO2vq#U%c:U%c2UOUQ*2oUOUQ*2oL"UOQ2oUOQ2oUO	VE2oUOQ2oVEVg1!)aAReturn line information about the selected text region.

If text is selected, the first and last indices will be
for the selection.  If there is no text selected, the
indices will be the current cursor location.

Return a tuple containing (first index, last index,
    string representation of text, list of text lines).
z
 linestartz-1c lineend +1czinsert linestartzinsert lineend +1crU)r	r%r&r*r'rJ)rr%r5r6�head�tail�charsr_s&       r�
get_region�FormatRegion.get_region�s����|�|� � ���l�l�8�8�:����T��:�:�e�l�2�3�D��:�:�d�%6�6�7�D��:�:�0�1�D��:�:�2�3�D�����$�����D�!���5�'�'rc�z�UOOoQOU2oVc6XcUO2P!UO	QQQ2UOQU2UO
2UOV2UOV2UO2UOQUQ2P!)a!Replace the text between the given indices.

Args:
    head: Starting index of text to replace.
    tail: Ending index of text to replace.
    chars: Expected to be string of current text
        between head and tail.
    lines: List of new lines to insert between head
        and tail.
rUr!r"r#r )r	r%r^�bellr-r.r/r0r r1�tag_add)rr�r�r�r_r%�newcharss&&&&&  r�
set_region�FormatRegion.set_region�s����|�|� � ���9�9�U�#�����I�I�K������u�e�,��
�
�h��%��������D�����D�#��������U�D�(�+rc�t�UO2vq#qE[[U22FDxoVV*oU%fJ[VpOO
2vq�V�OO*o	UOOU	2VxP*VV$Jz	UOV#VE2Q!)z$Indent region by indentwidth spaces.r$)	r�rYrMrr	r~�indentwidth�_make_blanksr��
rr3r�r�r�r_�posrQ�raw�	effectives
&&        r�indent_region_event� FormatRegion.indent_region_events���#'�?�?�#4� ��E���U��$�C��:�D��t�!0��|�|�7L�7L�!M���%���(@�(@�@�	�!�\�\�6�6�y�A�D��J�N��
�%�	
����E�1�rc��UO2vq#qE[[U22FD�oVV*oU%fJ[VpOO
2vq�[
V�OO*
]2o	UOOU	2VxP*VV$J�	UOV#VE2Q!)z$Dedent region by indentwidth spaces.r$)
r�rYrMrr	r~rqr�r�r�r�s
&&        r�dedent_region_event� FormatRegion.dedent_region_events���#'�?�?�#4� ��E���U��$�C��:�D��t�!0��|�|�7L�7L�!M����	�L�L�,D�,D� D�a�H�	�!�\�\�6�6�y�A�D��J�N��
�%�	
����E�1�rc��UO2vq#qE[[U2]*
2FDoVV*oQU*VV$J	UOV#VE2Q!)zbComment out each line in region.

## is appended to the beginning of each line to comment it out.
�##r$�r�rYrMr��rr3r�r�r�r_r�rQs&&      r�comment_region_event�!FormatRegion.comment_region_event sQ��
$(�?�?�#4� ��E���U��a��(�C��:�D����E�J�)�	
����E�1�rc��UO2vq#qE[[U22FDHoVV*oU%fJUQ*Q6XcUQ*oLUQ*Q6Xc
UQ*oVuU$JJ	UOV#VE2Q!)z�Uncomment each line in region.

Remove ## or # in the first positions of a line.  If the comment
is not in the beginning position, this command will have no effect.
:N�Nr�:r�NN:N�N�#:r�NNr$r�r�s&&      r�uncomment_region_event�#FormatRegion.uncomment_region_event,sx��$(�?�?�#4� ��E���U��$�C��:�D����B�x�4���B�x���b��S���B�x���#�J�%�	
����E�1�rc�R�UO2vq#qEUO2oUeP![[U22FDQoVW*oU%fJ[	V�2vq�[V�2vq�QU*QU**V�P*VW$JS	UO
V#VE2Q!)z@Convert leading spaces to tabs for each line in selected region.�	rVr$)r��_asktabwidthrYrMr�divmodr�)
rr3r�r�r�r_r~r�rQr�r��ntabs�nspacess
&&           r�tabify_region_event� FormatRegion.tabify_region_event?s���#'�?�?�#4� ��E��$�$�&�������U��$�C��:�D��t�!0��!@���!'�	�!<���!�E�\�C�'�M�9�D��J�F��
�%�	
����E�1�rc���UO2vq#qEUO2oUeP![[U22FDoVW*O	U2VW$J	UOV#VE2Q!)z.Expand tabs to spaces for each line in region.r$)r�r�rYrMrZr�)rr3r�r�r�r_r~r�s&&      r�untabify_region_event�"FormatRegion.untabify_region_eventNsb��#'�?�?�#4� ��E��$�$�&�������U��$�C���.�.�x�8�E�J�%�����E�1�rc	�v�[QQUOOUOO]]Q5!)zReturn value for tab width.z	Tab widthzColumns per tab? (2-16)��parent�initialvalue�minvalue�maxvalue)rr	r%r�rs&rr��FormatRegion._asktabwidthYs5����%��<�<�$�$����1�1���
�	rrr)r<r=r>r?r@r
r�r�r�r�r�r�r�r�r�rBrCrDs@rr�r��s?����$��(�,,�0
�
�
��&
�	��rr�c�8`�\sQsQsnQsQsQsQsQsUs	P!)�Indents�dzChange future indents.c��VmP!rrr
s&&rr
�Indents.__init__grrc��UOoUOo[QQQU**Q*QU**Q*Q*UOQ5%cU%(Um]UmQ!)	zToggle tabsz
Turn tabs z?
Indent width z 8.z!
 Note: a tab is always 8 columns)r�r$)�on�off)zwill bez
remains at)r	�usetabsrr%r�)rr3r	r�s&&  r�toggle_tabs_event�Indents.toggle_tabs_eventjsy���,�,���/�/�����]�7�3�3� �!�'��0�1�38�9�3�3��\�\�
#�#�#*�k�G�O�#$�G��rc	���UOo[QQUOUO]]Q5oU%c)V2O6wcUO%fV2mQ!)zIndent widthz6New indent width (2-16)
(Always use 8 when using tabs)r�r$)r	rr%r�r�)rr3r	rds&&  r�change_indentwidth_event� Indents.change_indentwidth_eventzsR���,�,��� �K� ���&�2�2���
���3�-�-�-�g�o�o�o�"%��rr)
r<r=r>r?r@r
r�r�rBrCrDs@rr�r�ds������� �rr�c�2`�\sQsQsnQsQQksQsUsP!)�Rstrip�c��VmP!rrr
s&&rr
�Rstrip.__init__�rrc���UOOoUOOoUO2[	[UO
Q222o[]U2FDpoUOQU*QU*2o[U2o[UO22oV�6fJOUOQVX1*QU*2Jr	UOQ2Q6Xc\[UOQ2%f@UO
Q2Q6�c*UOQ	2Q6XcUOQ	2J?UO2P!)
r#z%i.0z%i.endz%i.%izend-2crU�interpzend-1cr"zend-3c)r	r%�undor/r�floatr*rYr'rMr\r0�hasattrr1)	rr3r%r��end_line�cur�txtr��cuts	&&       r�	do_rstrip�Rstrip.do_rstrip�s���|�|� � ���|�|� � �������u�T�Z�Z��.�/�0����H�%�C��(�(�6�C�<��C��8�C��c�(�C��c�j�j�l�#�C��y����G�s�j�0�(�S�.�A�&�
�H�H�X��$�&��D�L�L�(�3�3��:�:�h�'�%�/��x�x��)�T�1����H�%�
	
���rrr)r<r=r>r?r
r�rBrCrDs@rr�r��s������rr��__main__)�mainzidlelib.idle_test.test_format)�	verbosity�exit)r@rX�tkinter.messageboxr�tkinter.simpledialogr�idlelib.configrrrr)r,r+rLrWr(�compiler}rr�r�r�r<�unittestr�rkrr�<module>r�s����
�'�+�#�@�@�F����">�J"�HM�,0�
0�	��*�*�Y�'��8�M�M�`!�!�H��@�z����	(�A�E�B�r

Youez - 2016 - github.com/yon3zu
LinuXploit