/opt/alt/python37/lib64/python3.7/idlelib/__pycache__
NameSizeModeActions
autocomplete.cpython-37.opt-1.pyc67960644editdlrm
autocomplete.cpython-37.opt-2.pyc53980644editdlrm
autocomplete.cpython-37.pyc67960644editdlrm
autocomplete_w.cpython-37.opt-1.pyc110320644editdlrm
autocomplete_w.cpython-37.opt-2.pyc102740644editdlrm
autocomplete_w.cpython-37.pyc110900644editdlrm
autoexpand.cpython-37.opt-1.pyc28260644editdlrm
autoexpand.cpython-37.opt-2.pyc20760644editdlrm
autoexpand.cpython-37.pyc28260644editdlrm
browser.cpython-37.opt-1.pyc94900644editdlrm
browser.cpython-37.opt-2.pyc68230644editdlrm
browser.cpython-37.pyc94900644editdlrm
calltip.cpython-37.opt-1.pyc55720644editdlrm
calltip.cpython-37.opt-2.pyc39510644editdlrm
calltip.cpython-37.pyc55720644editdlrm
calltip_w.cpython-37.opt-1.pyc61680644editdlrm
calltip_w.cpython-37.opt-2.pyc52350644editdlrm
calltip_w.cpython-37.pyc61680644editdlrm
codecontext.cpython-37.opt-1.pyc86950644editdlrm
codecontext.cpython-37.opt-2.pyc57000644editdlrm
codecontext.cpython-37.pyc87300644editdlrm
colorizer.cpython-37.opt-1.pyc102660644editdlrm
colorizer.cpython-37.opt-2.pyc81720644editdlrm
colorizer.cpython-37.pyc102660644editdlrm
config.cpython-37.opt-1.pyc298720644editdlrm
config.cpython-37.opt-2.pyc199520644editdlrm
config.cpython-37.pyc298720644editdlrm
configdialog.cpython-37.opt-1.pyc786130644editdlrm
configdialog.cpython-37.opt-2.pyc484560644editdlrm
configdialog.cpython-37.pyc786130644editdlrm
config_key.cpython-37.opt-1.pyc113390644editdlrm
config_key.cpython-37.opt-2.pyc99190644editdlrm
config_key.cpython-37.pyc113390644editdlrm
debugger.cpython-37.opt-1.pyc142190644editdlrm
debugger.cpython-37.opt-2.pyc140680644editdlrm
debugger.cpython-37.pyc142190644editdlrm
debugger_r.cpython-37.opt-1.pyc137710644editdlrm
debugger_r.cpython-37.opt-2.pyc113800644editdlrm
debugger_r.cpython-37.pyc138970644editdlrm
debugobj.cpython-37.opt-1.pyc51770644editdlrm
debugobj.cpython-37.opt-2.pyc51770644editdlrm
debugobj.cpython-37.pyc51770644editdlrm
debugobj_r.cpython-37.opt-1.pyc20180644editdlrm
debugobj_r.cpython-37.opt-2.pyc20180644editdlrm
debugobj_r.cpython-37.pyc20180644editdlrm
delegator.cpython-37.opt-1.pyc12800644editdlrm
delegator.cpython-37.opt-2.pyc11800644editdlrm
delegator.cpython-37.pyc12800644editdlrm
dynoption.cpython-37.opt-1.pyc22910644editdlrm
dynoption.cpython-37.opt-2.pyc19110644editdlrm
dynoption.cpython-37.pyc22910644editdlrm
editor.cpython-37.opt-1.pyc466050644editdlrm
editor.cpython-37.opt-2.pyc447050644editdlrm
editor.cpython-37.pyc466920644editdlrm
filelist.cpython-37.opt-1.pyc33760644editdlrm
filelist.cpython-37.opt-2.pyc33430644editdlrm
filelist.cpython-37.pyc34020644editdlrm
format.cpython-37.opt-1.pyc134400644editdlrm
format.cpython-37.opt-2.pyc97170644editdlrm
format.cpython-37.pyc134400644editdlrm
grep.cpython-37.opt-1.pyc77910644editdlrm
grep.cpython-37.opt-2.pyc50960644editdlrm
grep.cpython-37.pyc77910644editdlrm
help.cpython-37.opt-1.pyc103760644editdlrm
help.cpython-37.opt-2.pyc76070644editdlrm
help.cpython-37.pyc104180644editdlrm
help_about.cpython-37.opt-1.pyc73370644editdlrm
help_about.cpython-37.opt-2.pyc62150644editdlrm
help_about.cpython-37.pyc73370644editdlrm
history.cpython-37.opt-1.pyc33940644editdlrm
history.cpython-37.opt-2.pyc21690644editdlrm
history.cpython-37.pyc33940644editdlrm
hyperparser.cpython-37.opt-1.pyc67490644editdlrm
hyperparser.cpython-37.opt-2.pyc54420644editdlrm
hyperparser.cpython-37.pyc67490644editdlrm
idle.cpython-37.opt-1.pyc3390644editdlrm
idle.cpython-37.opt-2.pyc3390644editdlrm
idle.cpython-37.pyc3390644editdlrm
iomenu.cpython-37.opt-1.pyc137800644editdlrm
iomenu.cpython-37.opt-2.pyc133120644editdlrm
iomenu.cpython-37.pyc137800644editdlrm
macosx.cpython-37.opt-1.pyc75940644editdlrm
macosx.cpython-37.opt-2.pyc54120644editdlrm
macosx.cpython-37.pyc75940644editdlrm
mainmenu.cpython-37.opt-1.pyc34610644editdlrm
mainmenu.cpython-37.opt-2.pyc29900644editdlrm
mainmenu.cpython-37.pyc34610644editdlrm
multicall.cpython-37.opt-1.pyc149370644editdlrm
multicall.cpython-37.opt-2.pyc125720644editdlrm
multicall.cpython-37.pyc149940644editdlrm
outwin.cpython-37.opt-1.pyc60620644editdlrm
outwin.cpython-37.opt-2.pyc43780644editdlrm
outwin.cpython-37.pyc60620644editdlrm
parenmatch.cpython-37.opt-1.pyc63340644editdlrm
parenmatch.cpython-37.opt-2.pyc47880644editdlrm
parenmatch.cpython-37.pyc63340644editdlrm
pathbrowser.cpython-37.opt-1.pyc37430644editdlrm
pathbrowser.cpython-37.opt-2.pyc36020644editdlrm
pathbrowser.cpython-37.pyc37430644editdlrm
percolator.cpython-37.opt-1.pyc35160644editdlrm
percolator.cpython-37.opt-2.pyc35160644editdlrm
percolator.cpython-37.pyc36540644editdlrm
pyparse.cpython-37.opt-1.pyc116390644editdlrm
pyparse.cpython-37.opt-2.pyc80600644editdlrm
pyparse.cpython-37.pyc119880644editdlrm
pyshell.cpython-37.opt-1.pyc422510644editdlrm
pyshell.cpython-37.opt-2.pyc395230644editdlrm
pyshell.cpython-37.pyc423810644editdlrm
query.cpython-37.opt-1.pyc128150644editdlrm
query.cpython-37.opt-2.pyc100930644editdlrm
query.cpython-37.pyc128150644editdlrm
redirector.cpython-37.opt-1.pyc67630644editdlrm
redirector.cpython-37.opt-2.pyc33310644editdlrm
redirector.cpython-37.pyc67630644editdlrm
replace.cpython-37.opt-1.pyc93580644editdlrm
replace.cpython-37.opt-2.pyc65160644editdlrm
replace.cpython-37.pyc93580644editdlrm
rpc.cpython-37.opt-1.pyc196040644editdlrm
rpc.cpython-37.opt-2.pyc160580644editdlrm
rpc.cpython-37.pyc196910644editdlrm
run.cpython-37.opt-1.pyc176770644editdlrm
run.cpython-37.opt-2.pyc152020644editdlrm
run.cpython-37.pyc177250644editdlrm
runscript.cpython-37.opt-1.pyc70700644editdlrm
runscript.cpython-37.opt-2.pyc58360644editdlrm
runscript.cpython-37.pyc70700644editdlrm
scrolledlist.cpython-37.opt-1.pyc54030644editdlrm
scrolledlist.cpython-37.opt-2.pyc54030644editdlrm
scrolledlist.cpython-37.pyc54030644editdlrm
search.cpython-37.opt-1.pyc59310644editdlrm
search.cpython-37.opt-2.pyc34390644editdlrm
search.cpython-37.pyc59310644editdlrm
searchbase.cpython-37.opt-1.pyc80370644editdlrm
searchbase.cpython-37.opt-2.pyc52770644editdlrm
searchbase.cpython-37.pyc80370644editdlrm
searchengine.cpython-37.opt-1.pyc68410644editdlrm
searchengine.cpython-37.opt-2.pyc51910644editdlrm
searchengine.cpython-37.pyc68410644editdlrm
sidebar.cpython-37.opt-1.pyc109870644editdlrm
sidebar.cpython-37.opt-2.pyc95390644editdlrm
sidebar.cpython-37.pyc109870644editdlrm
squeezer.cpython-37.opt-1.pyc95200644editdlrm
squeezer.cpython-37.opt-2.pyc63330644editdlrm
squeezer.cpython-37.pyc95570644editdlrm
stackviewer.cpython-37.opt-1.pyc50540644editdlrm
stackviewer.cpython-37.opt-2.pyc50540644editdlrm
stackviewer.cpython-37.pyc50540644editdlrm
statusbar.cpython-37.opt-1.pyc19490644editdlrm
statusbar.cpython-37.opt-2.pyc19490644editdlrm
statusbar.cpython-37.pyc19490644editdlrm
textview.cpython-37.opt-1.pyc70650644editdlrm
textview.cpython-37.opt-2.pyc49090644editdlrm
textview.cpython-37.pyc70650644editdlrm
tooltip.cpython-37.opt-1.pyc65700644editdlrm
tooltip.cpython-37.opt-2.pyc49480644editdlrm
tooltip.cpython-37.pyc65700644editdlrm
tree.cpython-37.opt-1.pyc156960644editdlrm
tree.cpython-37.opt-2.pyc143520644editdlrm
tree.cpython-37.pyc156960644editdlrm
undo.cpython-37.opt-1.pyc107690644editdlrm
undo.cpython-37.opt-2.pyc107690644editdlrm
undo.cpython-37.pyc107690644editdlrm
window.cpython-37.opt-1.pyc31950644editdlrm
window.cpython-37.opt-2.pyc31950644editdlrm
window.cpython-37.pyc31950644editdlrm
zoomheight.cpython-37.opt-1.pyc27980644editdlrm
zoomheight.cpython-37.opt-2.pyc27490644editdlrm
zoomheight.cpython-37.pyc27980644editdlrm
zzdummy.cpython-37.opt-1.pyc12100644editdlrm
zzdummy.cpython-37.opt-2.pyc11420644editdlrm
zzdummy.cpython-37.pyc12100644editdlrm
__init__.cpython-37.opt-1.pyc5130644editdlrm
__init__.cpython-37.opt-2.pyc1510644editdlrm
__init__.cpython-37.pyc5130644editdlrm
__main__.cpython-37.opt-1.pyc2740644editdlrm
__main__.cpython-37.opt-2.pyc2030644editdlrm
__main__.cpython-37.pyc2740644editdlrm
Edit: /opt/alt/python37/lib64/python3.7/idlelib/__pycache__/format.cpython-37.opt-1.pyc (13440B)
B  f¡=ã@sØdZddlZddlmZddlmZddlmZGdd„dƒZe  ¡dd „Z d d „Z d d „Z dd„Z dd„Zdd„Ze d¡Zdd„ZGdd„dƒZGdd„dƒZGdd„dƒZedkrÔddlmZedd d!d"dS)#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. éN)Úaskyesno)Ú askinteger)ÚidleConfc@s6eZdZdZdd„Zedd„ƒZdd„Zd d d „ZdS) ÚFormatParagraphaFormat 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 :-) cCs ||_dS)N)Úeditwin)Úselfr©rú3/opt/alt/python37/lib64/python3.7/idlelib/format.pyÚ__init__szFormatParagraph.__init__cCstjdddddd|_dS)NÚ extensionsrz max-widthÚintéH)ÚtypeÚdefault)rZ GetOptionÚ max_width)Úclsrrr Úreload"szFormatParagraph.reloadcCs d|_dS)N)r)rrrr Úclose'szFormatParagraph.closeNc Csà|dkr|jn|}|jj}|j ¡\}}|rF|rF| ||¡}t|ƒ}nt|| d¡ƒ\}}}}|rpt|||ƒ}n t ||ƒ}|  ddd¡||krÆ|  d|¡|  ¡|  ||¡| ||¡| ¡n |  d|¡| d¡dS)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. NÚinsertÚselz1.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_stopZsee) rÚeventÚlimitrÚfirstÚlastÚdataÚcomment_headerÚnewdatarrr Úformat_paragraph_event*s(          z&FormatParagraph.format_paragraph_event)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__r Ú classmethodrrr,rrrr rs  rc CsFtt| d¡ƒ\}}| d|d|¡}x:| d|dd¡rbt|ƒrb|d}| d|d|¡}q*W|}t|ƒ}t|ƒ}x¡sz#reformat_comment..éÚéÿÿÿÿNc3s|]}ˆ|VqdS)Nr)rMr;)r*rr rO°s)r8rFr6Úmaxr)r)r&r*Z format_widthr+Z block_suffixr)r*rNr rœs   rcCst d|¡dk S)z/Return True if line is empty or all whitespace.z^\s*$N)r@Úmatch)r;rrr r7²sr7cCst d|¡ ¡S)z/Return the initial space or tab indent of line.z ^([ \t]*))r@rTÚgroup)r;rrr r?·sr?cCs"t d|¡}|dkrdS| d¡S)aReturn 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]*#*)NrQr4)r@rTrU)r;Úmrrr r»s rz[ \t]*cCs$t |¡}| ¡t| ¡ |¡ƒfS)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_rerTrr8rUrB)r;ÚtabwidthrVrrr Úget_line_indentÊs rYc@sleZdZdZdd„Zdd„Zdd„Zdd d „Zdd d „Zdd d„Z ddd„Z ddd„Z ddd„Z dd„Z dS)Ú FormatRegionzFormat selected text (region).cCs ||_dS)N)r)rrrrr r ×szFormatRegion.__init__cCsr|jj}|j ¡\}}|r<|r<| |d¡}| |d¡}n| d¡}| d¡}| ||¡}| d¡}||||fS)aqReturn 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 +1cr<)rrrrrr6)rrr'r(ÚheadÚtailÚcharsrGrrr Ú get_regionÚs     zFormatRegion.get_regioncCsz|jj}d |¡}||kr&| ¡dS| ddd¡| d|¡| ¡| ||¡| ||¡|  ¡|  d|d¡dS)aaReplace 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. r<Nrz1.0rr) rrrFZbellr r!r"r#rr$Ztag_add)rr[r\r]rGrÚnewcharsrrr Ú set_regionðs     zFormatRegion.set_regionNc Cs€| ¡\}}}}xZtt|ƒƒD]J}||}|rt||jjƒ\}} | |jj} |j | ¡||d…||<qW| ||||¡dS)z$Indent region by indentwidth spaces.Nr) r^rAr8rYrrXÚ indentwidthÚ _make_blanksr`) rr%r[r\r]rGÚposr;ÚrawÚ effectiverrr Úindent_region_events  z FormatRegion.indent_region_eventc Cs†| ¡\}}}}x`tt|ƒƒD]P}||}|rt||jjƒ\}} t| |jjdƒ} |j | ¡||d…||<qW|  ||||¡dS)z$Dedent region by indentwidth spaces.rNr) r^rAr8rYrrXrSrarbr`) rr%r[r\r]rGrcr;rdrerrr Údedent_region_events z FormatRegion.dedent_region_eventcCsR| ¡\}}}}x,tt|ƒdƒD]}||}d|||<q"W| ||||¡dS)zrComment out each line in region. ## is appended to the beginning of each line to comment it out. r4z##r)r^rAr8r`)rr%r[r\r]rGrcr;rrr Úcomment_region_event s z!FormatRegion.comment_region_eventcCsŠ| ¡\}}}}xdtt|ƒƒD]T}||}|s0q|dd…dkrN|dd…}n|dd…dkrj|dd…}|||<qW| ||||¡dS)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. Nr=z##r4ú#r)r^rAr8r`)rr%r[r\r]rGrcr;rrr Úuncomment_region_event,s  z#FormatRegion.uncomment_region_eventc Cs–| ¡\}}}}| ¡}|dkr$dSx\tt|ƒƒD]L}||}|r2t||ƒ\} } t| |ƒ\} } d| d| || d…||<q2W| ||||¡dS)z@Convert leading spaces to tabs for each line in selected region.Nú r>r)r^Ú _asktabwidthrAr8rYÚdivmodr`) rr%r[r\r]rGrXrcr;rdreZntabsZnspacesrrr Útabify_region_event?s$z FormatRegion.tabify_region_eventcCs`| ¡\}}}}| ¡}|dkr$dSx&tt|ƒƒD]}|| |¡||<q2W| ||||¡dS)z.Expand tabs to spaces for each line in region.Nr)r^rlrAr8rBr`)rr%r[r\r]rGrXrcrrr Úuntabify_region_eventNsz"FormatRegion.untabify_region_eventcCstdd|jj|jjdddS)zReturn value for tab width.z Tab widthzColumns per tab? (2-16)r=é)ÚparentÚ initialvalueÚminvalueÚmaxvalue)rrrra)rrrr rlYszFormatRegion._asktabwidth)N)N)N)N)N)N)r-r.r/r0r r^r`rfrgrhrjrnrorlrrrr rZÔs   rZc@s(eZdZdZdd„Zdd„Zdd„ZdS) ÚIndentszChange future indents.cCs ||_dS)N)r)rrrrr r gszIndents.__init__cCsJ|j}|j}tddd|dd|dd|jdrF| |_d |_d S) Nz Toggle tabsz Turn tabs )ZonZoffz? Indent width )zwill bez remains atz 8.z! Note: a tab is always 8 columns)rqér)rÚusetabsrrra)rr%rrwrrr Útoggle_tabs_eventjs zIndents.toggle_tabs_eventcCs<|j}tdd|j|jddd}|r8||jkr8|js8||_dS)Nz Indent widthz6New indent width (2-16) (Always use 8 when using tabs)r=rp)rqrrrsrtr)rrrrarw)rr%rrJrrr Úchange_indentwidth_eventzsz Indents.change_indentwidth_eventN)r-r.r/r0r rxryrrrr rudsruc@seZdZdd„Zddd„ZdS)ÚRstripcCs ||_dS)N)r)rrrrr r ‰szRstrip.__init__Nc CsØ|jj}|jj}| ¡tt| d¡ƒƒ}xZtd|ƒD]L}| d|d|¡}t |ƒ}t |  ¡ƒ}||kr6|  d||fd|¡q6W| d¡dkrÌt |jdƒsÌx*| d ¡d krÊ| d ¡dkrÊ|  d ¡q¢W|  ¡dS) Nrr4z%i.0z%i.endz%i.%izend-2cr<Zinterpzend-1cz1.0zend-3c)rrÚundor"r ÚfloatrrArr8rDr#Úhasattrr$) rr%rr{Zend_lineZcurZtxtrdZcutrrr Ú do_rstripŒs   zRstrip.do_rstrip)N)r-r.r/r r~rrrr rzˆsrzÚ__main__)Úmainzidlelib.idle_test.test_formatr=F)Ú verbosityÚexit)r0r@Ztkinter.messageboxrZtkinter.simpledialogrZidlelib.configrrrrrrr7r?rÚcompilerWrYrZrurzr-Zunittestr€rrrr Ús*   C%$  $