Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \';ã@sŽdZddlZddlZejdedd�dZGdd„dƒZGdd „d ƒZGd d „d ƒZGd d „d eƒZ Gdd„deƒZ ddd„Z e dkrŠe ƒdS)aGeneric output formatting. Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor any sort of ``change back'' operation. Specific writer properties which may be controlled via formatter objects are horizontal alignment, font, and left margin indentations. A mechanism is provided which supports providing arbitrary, non-exclusive style settings to a writer as well. Additional interfaces facilitate formatting events which are not reversible, such as paragraph separation. Writer objects encapsulate device interfaces. Abstract devices, such as file formats, are supported as well as physical devices. The provided implementations all work with abstract devices. The interface makes available mechanisms for setting the properties which formatter objects manage and inserting data into the output. éNz"the formatter module is deprecatedé)Ú stacklevelc@s¨eZdZdZd(dd„Zdd„Zdd„Zd d „Zd)d d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd*d$d%„Zd+d&d'„ZdS),Ú NullFormattera=A formatter which does nothing. If the writer parameter is omitted, a NullWriter instance is created. No methods of the writer are called by NullFormatter instances. Implementations should inherit from this class if implementing a writer interface but don't need to inherit any implementation. NcCs|dkrtƒ}||_dS)N)Ú NullWriterÚwriter)Úselfr©rú!/usr/lib64/python3.6/formatter.pyÚ__init__)szNullFormatter.__init__cCsdS)Nr)rÚ blanklinerrr Ú end_paragraph-szNullFormatter.end_paragraphcCsdS)Nr)rrrr Úadd_line_break.szNullFormatter.add_line_breakcOsdS)Nr)rÚargsÚkwrrr Ú add_hor_rule/szNullFormatter.add_hor_rulecCsdS)Nr)rÚformatÚcounterr rrr Úadd_label_data0szNullFormatter.add_label_datacCsdS)Nr)rÚdatarrr Úadd_flowing_data1szNullFormatter.add_flowing_datacCsdS)Nr)rrrrr Úadd_literal_data2szNullFormatter.add_literal_datacCsdS)Nr)rrrr Úflush_softspace3szNullFormatter.flush_softspacecCsdS)Nr)rÚalignrrr Úpush_alignment4szNullFormatter.push_alignmentcCsdS)Nr)rrrr Ú pop_alignment5szNullFormatter.pop_alignmentcCsdS)Nr)rÚxrrr Ú push_font6szNullFormatter.push_fontcCsdS)Nr)rrrr Úpop_font7szNullFormatter.pop_fontcCsdS)Nr)rÚmarginrrr Ú push_margin8szNullFormatter.push_margincCsdS)Nr)rrrr Ú pop_margin9szNullFormatter.pop_margincCsdS)Nr)rÚspacingrrr Ú set_spacing:szNullFormatter.set_spacingcGsdS)Nr)rÚstylesrrr Ú push_style;szNullFormatter.push_styleécCsdS)Nr)rÚnrrr Ú pop_style<szNullFormatter.pop_stylecCsdS)Nr)rÚflagrrr Úassert_line_data=szNullFormatter.assert_line_data)N)N)r%)r%)Ú__name__Ú __module__Ú __qualname__Ú__doc__r r r rrrrrrrrrrr r"r$r'r)rrrr rs&    rc@s¾eZdZdZdd„Zdd„Zdd„Zdd „Zd.d d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd/d*d+„Zd0d,d-„Zd S)1ÚAbstractFormatterzêThe standard formatter. This implementation has demonstrated wide applicability to many writers, and may be used directly in most circumstances. It has been used to implement a full-featured World Wide Web browser. cCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_ d|_ d|_ d|_ dS)Nr%r) rrÚ align_stackÚ font_stackÚ margin_stackr!Ú style_stackÚnospaceÚ softspaceÚpara_endÚparskipÚ hard_breakÚ have_label)rrrrr r NszAbstractFormatter.__init__cCsb|js|jjƒd|_|j|krF|j rF|jj||jƒ||_d|_d|_|_|_d|_dS)Nrr%) r7rÚsend_line_breakr8r6Úsend_paragraphr3r5r4)rr rrr r ]s zAbstractFormatter.end_paragraphcCs8|jp |js"|jjƒd|_|_d|_|_d|_dS)Nrr%)r7r5rr9r8r6r3r4)rrrr r hs     z AbstractFormatter.add_line_breakcOsF|js|jjƒ|jj||Žd|_|_d|_|_|_|_dS)Nr%r) r7rr9Ú send_hor_ruler3r8r5r4r6)rrrrrr ros   zAbstractFormatter.add_hor_ruleNcCs†|js|j r|jjƒ|js2|jj|r,dp.dƒt|tƒrR|jj|j ||ƒƒn |jj|ƒd|_ |_|_|_d|_ |_ dS)Nr%r) r8r7rr9r5r:Ú isinstanceÚstrÚsend_label_dataÚformat_counterr3r4r6)rrrr rrr rvs   z AbstractFormatter.add_label_datacCsxd}xn|D]f}|dkr$|d|}q |dkrF|dkrp||j||ƒ}q |dkrh|dkrp||j||ƒ}q ||}q W|S)NÚÚ1z%dZaArZiI)Ú format_letterÚ format_roman)rrrÚlabelÚcrrr r?‚s  z AbstractFormatter.format_countercCs@d}x6|dkr:t|ddƒ\}}tt|ƒ|ƒ}||}qW|S)Nr@rr%é)ÚdivmodÚchrÚord)rÚcaserrDrÚsrrr rB‘s   zAbstractFormatter.format_letterc CsÌddddg}dddg}d\}}x˜|d kr¶t|d ƒ\}}|d krX||||d |}nT|d krv|||||}n6|dkr�||}|d}nd}||||}||}|d }q W|dkrÈ|jƒS|S)NÚirrEÚmÚvÚlÚdr@ré é r%ééÚI)r@r)rGÚupper) rrJrZonesZfivesrDÚindexrrKrrr rCœs&     zAbstractFormatter.format_romancCs¬|sdS|dd…jƒ}|dd…jƒ}dj|jƒƒ}|jrF| rFdS|sP|jrx|sj|jsfd|_d|_dS|jsxd|}d|_|_|_|_|_||_|j j |ƒdS)Nr%ú réÿÿÿÿ) ÚisspaceÚjoinÚsplitr3r4r6r7r5r8rÚsend_flowing_data)rrZprespaceZ postspacerrr r´s$  z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|jjdƒ|dd…dk|_d|_|_|_|_|_|jj|ƒdS)NrXr%Ú rrY) r4rr]r7r3r5r6r8Úsend_literal_data)rrrrr rÈs z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|jjdƒdS)Nrr%rX)r4r7r5r6r8r3rr])rrrr rÑsz!AbstractFormatter.flush_softspacecCs@|r.||jkr.|jj|ƒ||_|jj|ƒn|jj|jƒdS)N)rrÚ new_alignmentr/Úappend)rrrrr rØs  z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|jj|ƒnd|_|jjdƒdS)Nr%rYrY)r/rrr`)rrrrr ràszAbstractFormatter.pop_alignmentc Cs¦|\}}}}|jr6d|_|_|_d|_|jjdƒ|jr~|jd\}}}} |tkrZ|}|tkrf|}|tkrr|}|tkr~| }||||f}|jj|ƒ|jj |ƒdS)Nrr%rXrY) r4r7r5r3rr]r0ÚAS_ISraÚnew_font) rÚfontÚsizerLÚbZttZcsizeZciÚcbZcttrrr rês$    zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|jj|ƒdS)Nr%rYrY)r0rrc)rrdrrr rús  zAbstractFormatter.pop_fontcCsD|jj|ƒdd„|jDƒ}| r.|r.|d}|jj|t|ƒƒdS)NcSsg|] }|r|‘qSrr)Ú.0rMrrr ú sz1AbstractFormatter.push_margin..r%rY)r1rarÚ new_marginÚlen)rrÚfstackrrr rs   zAbstractFormatter.push_margincCsF|jr|jd=dd„|jDƒ}|r,|d}nd}|jj|t|ƒƒdS)Nr%cSsg|] }|r|‘qSrr)rhrMrrr ri sz0AbstractFormatter.pop_margin..rYrY)r1rrjrk)rrlrrrr r s zAbstractFormatter.pop_margincCs||_|jj|ƒdS)N)r!rÚ new_spacing)rr!rrr r"szAbstractFormatter.set_spacingcGsZ|jr*d|_|_|_d|_|jjdƒx|D]}|jj|ƒq0W|jjt |jƒƒdS)Nrr%rX) r4r7r5r3rr]r2raÚ new_stylesÚtuple)rr#Zstylerrr r$s  zAbstractFormatter.push_styler%cCs$|j| d…=|jjt|jƒƒdS)N)r2rrnro)rr&rrr r'!szAbstractFormatter.pop_stylecCs$| |_|_d|_|_|_dS)Nr)r3r7r5r6r8)rr(rrr r)%sz"AbstractFormatter.assert_line_data)N)r%)r%)r*r+r,r-r r r rrr?rBrCrrrrrrrrr r"r$r'r)rrrr r.@s,        r.c@sxeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)raMinimal writer interface to use in testing & inheritance. A writer which only provides the interface definition; no actions are taken on any methods. This should be the base class for all writers which do not need to inherit any implementation methods. cCsdS)Nr)rrrr r 2szNullWriter.__init__cCsdS)Nr)rrrr Úflush3szNullWriter.flushcCsdS)Nr)rrrrr r`4szNullWriter.new_alignmentcCsdS)Nr)rrdrrr rc5szNullWriter.new_fontcCsdS)Nr)rrÚlevelrrr rj6szNullWriter.new_margincCsdS)Nr)rr!rrr rm7szNullWriter.new_spacingcCsdS)Nr)rr#rrr rn8szNullWriter.new_stylescCsdS)Nr)rr rrr r:9szNullWriter.send_paragraphcCsdS)Nr)rrrr r9:szNullWriter.send_line_breakcOsdS)Nr)rrrrrr r;;szNullWriter.send_hor_rulecCsdS)Nr)rrrrr r><szNullWriter.send_label_datacCsdS)Nr)rrrrr r]=szNullWriter.send_flowing_datacCsdS)Nr)rrrrr r_>szNullWriter.send_literal_dataN)r*r+r,r-r rpr`rcrjrmrnr:r9r;r>r]r_rrrr r*src@sheZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„ZdS)ÚAbstractWriterz°A writer which can be used in debugging formatters, but not much else. Each method simply announces itself by printing its name and arguments on standard output. cCstd|fƒdS)Nznew_alignment(%r))Úprint)rrrrr r`IszAbstractWriter.new_alignmentcCstd|fƒdS)Nz new_font(%r))rs)rrdrrr rcLszAbstractWriter.new_fontcCstd||fƒdS)Nznew_margin(%r, %d))rs)rrrqrrr rjOszAbstractWriter.new_margincCstd|fƒdS)Nznew_spacing(%r))rs)rr!rrr rmRszAbstractWriter.new_spacingcCstd|fƒdS)Nznew_styles(%r))rs)rr#rrr rnUszAbstractWriter.new_stylescCstd|fƒdS)Nzsend_paragraph(%r))rs)rr rrr r:XszAbstractWriter.send_paragraphcCs tdƒdS)Nzsend_line_break())rs)rrrr r9[szAbstractWriter.send_line_breakcOs tdƒdS)Nzsend_hor_rule())rs)rrrrrr r;^szAbstractWriter.send_hor_rulecCstd|fƒdS)Nzsend_label_data(%r))rs)rrrrr r>aszAbstractWriter.send_label_datacCstd|fƒdS)Nzsend_flowing_data(%r))rs)rrrrr r]dsz AbstractWriter.send_flowing_datacCstd|fƒdS)Nzsend_literal_data(%r))rs)rrrrr r_gsz AbstractWriter.send_literal_dataN)r*r+r,r-r`rcrjrmrnr:r9r;r>r]r_rrrr rrAsrrc@sJeZdZdZddd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dS)Ú DumbWritera;Simple writer class which writes output on the file object passed in as the file parameter or, if file is omitted, on standard output. The output is simply word-wrapped to the number of columns specified by the maxcol parameter. This class is suitable for reflowing a sequence of paragraphs. NéHcCs(|ptj|_||_tj|ƒ|jƒdS)N)ÚsysÚstdoutÚfileÚmaxcolrr Úreset)rrxryrrr r ts  zDumbWriter.__init__cCsd|_d|_dS)Nr)ÚcolÚatbreak)rrrr rzzszDumbWriter.resetcCs |jjd|ƒd|_d|_dS)Nr^r)rxÚwriter{r|)rr rrr r:~szDumbWriter.send_paragraphcCs|jjdƒd|_d|_dS)Nr^r)rxr}r{r|)rrrr r9ƒs zDumbWriter.send_line_breakcOs:|jjdƒ|jjd|jƒ|jjdƒd|_d|_dS)Nr^ú-r)rxr}ryr{r|)rrrrrr r;ˆs   zDumbWriter.send_hor_rulecCsV|jj|ƒ|jdƒ}|dkr4d|_||dd…}|jƒ}|jt|ƒ|_d|_dS)Nr^rr%)rxr}Úrfindr{Ú expandtabsrkr|)rrrLrrr r_�s  zDumbWriter.send_literal_datacCs¢|sdS|jp|djƒ}|j}|j}|jj}xZ|jƒD]N}|rn|t|ƒ|kr^|dƒd}n|dƒ|d}||ƒ|t|ƒ}d}q8W||_|djƒ|_dS)Nrr^rXr%rY)r|rZr{ryrxr}r\rk)rrr|r{ryr}Zwordrrr r]™s$ zDumbWriter.send_flowing_data)Nru) r*r+r,r-r rzr:r9r;r_r]rrrr rtks  rtc Cs˜tƒ}t|ƒ}|dk r t|ƒ}n$tjdd…r>ttjdƒ}ntj}z0x*|D]"}|dkrd|jdƒqL|j|ƒqLWWd|tjk rˆ|jƒX|jdƒdS)Nr%r^r) rtr.ÚopenrvÚargvÚstdinr rÚclose)rxÚwÚfÚfpÚlinerrr Útest®s     r‰Ú__main__)N) r-rvÚwarningsÚwarnÚDeprecationWarningrbrr.rrrrtr‰r*rrrr Ús"k*C