/usr/local/lib/python3.6/site-packages/click/__pycache__
NameSizeModeActions
core.cpython-36.pyc879320644editdlrm
decorators.cpython-36.pyc143500644editdlrm
exceptions.cpython-36.pyc100380644editdlrm
formatting.cpython-36.pyc92390644editdlrm
globals.cpython-36.pyc23600644editdlrm
parser.cpython-36.pyc134390644editdlrm
shell_completion.cpython-36.pyc166130644editdlrm
termui.cpython-36.pyc262610644editdlrm
testing.cpython-36.pyc146710644editdlrm
types.cpython-36.pyc329570644editdlrm
utils.cpython-36.pyc177250644editdlrm
_compat.cpython-36.pyc156730644editdlrm
_termui_impl.cpython-36.pyc156500644editdlrm
_textwrap.cpython-36.pyc14650644editdlrm
_unicodefun.cpython-36.pyc22950644editdlrm
_winconsole.cpython-36.pyc76780644editdlrm
__init__.cpython-36.pyc26480644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/click/__pycache__/formatting.cpython-36.pyc (9239B)
3 _TBg%@sUddlZddlmZddlmZddlmZddlm Z dZ ej e  ej ejeefeje dfdd d Zej ejeefe ejejedfd d d Zdee eeeedddZGdddZejeejeefdddZdS)N)contextmanager)gettext)term_len) split_opt.)rowsreturncCs\i}x<|D]4}x.t|D]"\}}t|j|dt|||<qWq Wtddt|jDS)Nrcss|]\}}|VqdS)N).0xyr r 1/tmp/pip-build-0s3hx122/click/click/formatting.py sz measure_table..) enumeratemaxgetrtuplesorteditems)rwidthsrowidxcolr r r measure_table s  "r)r col_countrccs(x"|D]}|d|t|VqWdS)N)r)len)rrrr r r iter_rowss rNrF)textwidthinitial_indentsubsequent_indentpreserve_paragraphsrc s ddlm}|j}||||dd}|s2|j|Sggdddfdd }xN|jD]B}|sr|dq^dkrt|} |j}| t|j|q^W|g} xRD]J\} }|jd ,| r| j|j |n| j|j|WdQRXqWd j | S) aA helper function that intelligently wraps text. By default, it assumes that it operates on a single paragraph of text but if the `preserve_paragraphs` parameter is provided it will intelligently handle paragraphs (defined by two empty lines). If paragraphs are handled, a paragraph can be prefixed with an empty line containing the ``\b`` character (``\x08``) to indicate that no rewrapping should happen in that block. :param text: the text that should be rewrapped. :param width: the maximum width for the text. :param initial_indent: the initial indent that should be placed on the first line as a string. :param subsequent_indent: the indent string that should be placed on each consecutive line. :param preserve_paragraphs: if this flag is set then the wrapping will intelligently handle paragraphs. r) TextWrapperF)r!r"replace_whitespaceN)rcsdsdSdjdkr<jp"dddjddfnjpFdddjfdd=dS)NrT rF )stripappendjoinr )bufindentpr r _flush_parFs $zwrap_text.._flush_parr(z ) Z _textwrapr$ expandtabsfill splitlinesrlstripr*Z extra_indentZ indent_onlyr+) rr r!r"r#r$wrapperr/lineZorig_lenrvrawr )r,r-r.r wrap_texts<    r8c@seZdZdZd&eejeejeddddZedddd Z dd d d Z dd d dZ d'eeejeddddZ eddddZ dd ddZeddddZd(ejejeefeeddddZeeejddd d!Zeejdd d"d#Zed d$d%ZdS)) HelpFormatteraThis class helps with formatting text-based help pages. It's usually just needed for very special internal cases, but it's also exposed so that developers can write their own fancy outputs. At present, it always writes into memory. :param indent_increment: the additional increment for each level. :param width: the width for the text. This defaults to the terminal width clamped to a maximum of 78. N)indent_incrementr max_widthrcCs^ddl}||_|dkrd}|dkrHt}|dkrHtt|jj|dd}||_d|_g|_ dS)NrPr:2) shutilr; FORCED_WIDTHrminget_terminal_sizecolumnsr current_indentbuffer)selfr;r r<r?r r r __init__rszHelpFormatter.__init__)stringrcCs|jj|dS)z1Writes a unicode string into the internal buffer.N)rEr*)rFrHr r r writeszHelpFormatter.write)rcCs|j|j7_dS)zIncreases the indentation.N)rDr;)rFr r r r-szHelpFormatter.indentcCs|j|j8_dS)zDecreases the indentation.N)rDr;)rFr r r dedentszHelpFormatter.dedentr)progargsprefixrcCs|dkrtdd}|d|j|d}|j|j}|t|dkrndt|}|jt||||dnB|j||jddt|jt|d}|jt||||d|jddS) zWrites a usage line into the buffer. :param prog: the program name. :param args: whitespace separated list of arguments. :param prefix: The prefix for the first line. Defaults to ``"Usage: "``. NzUsage:r(>)r!r"r')_rDr rrIr8r)rFrKrLrMZ usage_prefix text_widthr-r r r write_usages&      zHelpFormatter.write_usage)headingrcCs"|jdd|j|ddS)z!Writes a heading into the buffer.rrNz: N)rIrD)rFrTr r r write_headingszHelpFormatter.write_headingcCs|jr|jddS)z#Writes a paragraph into the buffer.r'N)rErI)rFr r r write_paragraphszHelpFormatter.write_paragraph)rrcCs2d|j}|jt||j||dd|jddS)zaWrites re-indented text into the buffer. This rewraps and preserves paragraphs. r(T)r!r"r#r'N)rDrIr8r )rFrr-r r r write_texts  zHelpFormatter.write_text)rcol_max col_spacingrc CsVt|}t|}t|dkr$tdt|d||}xt|t|D]\}}|jdd|j||s~|jdqHt|||kr|jd|t|n|jd|jd||jt |j |dd}t ||d d } | j } | rD|j| ddxD| d d D](} |jdd||j| dqWqH|jdqHWd S) anWrites a definition list into the buffer. This is how options and commands are usually formatted. :param rows: a list of two item tuples for the terms and values. :param col_max: the maximum width of the first column. :param col_spacing: the number of spaces between the first and second column. r:z(Expected two columns for definition listrrrNr'r( T)r#rN) listrr TypeErrorrArrIrDrrr r8r2) rFrrYrZrZ first_colfirstsecondrRZ wrapped_textlinesr5r r r write_dls,   *zHelpFormatter.write_dl)namerc cs4|j|j||jz dVWd|jXdS)zHelpful context manager that writes a paragraph, a heading, and the indents. :param name: the section name that is written as heading. N)rVrUr-rJ)rFrbr r r sections   zHelpFormatter.sectionc cs"|jz dVWd|jXdS)z1A context manager that increases the indentation.N)r-rJ)rFr r r indentation s zHelpFormatter.indentationcCs dj|jS)zReturns the buffer contents.r)r+rE)rFr r r getvalueszHelpFormatter.getvalue)r:NN)rN)rXr:)__name__ __module__ __qualname____doc__inttOptionalrGstrrIr-rJrSrUrVrWSequenceTuplerarIteratorrcrdrer r r r r9fs* &'r9)optionsrcCshg}d}x6|D].}t|d}|dkr*d}|jt||fqW|jddddjd d |D|fS) a Given a list of option strings this joins them in the most appropriate way and returns them in the form ``(formatted_string, any_prefix_is_slash)`` where the second item in the tuple is a flag that indicates if any of the option prefixes was a slash. Fr/TcSs|dS)Nrr )r r r r ,szjoin_options..)keyz, css|]}|dVqdS)rNr )r r r r r r-szjoin_options..)rr*rsortr+)rqr6Zany_prefix_is_slashoptrMr r r join_optionss  rw)rrrF)Ztypingrk contextlibrrrQ_compatrparserrr@rlrjIterablerormrrprboolr8r9rnrwr r r r s"    *  C6