/opt/alt/python38/lib/python3.8/site-packages/click/__pycache__
NameSizeModeActions
core.cpython-38.pyc567880644editdlrm
decorators.cpython-38.pyc113560644editdlrm
exceptions.cpython-38.pyc76930644editdlrm
formatting.cpython-38.pyc85810644editdlrm
globals.cpython-38.pyc18800644editdlrm
parser.cpython-38.pyc115500644editdlrm
termui.cpython-38.pyc189160644editdlrm
testing.cpython-38.pyc103170644editdlrm
types.cpython-38.pyc175110644editdlrm
utils.cpython-38.pyc141840644editdlrm
_bashcomplete.cpython-38.pyc23650644editdlrm
_compat.cpython-38.pyc156430644editdlrm
_termui_impl.cpython-38.pyc130940644editdlrm
_textwrap.cpython-38.pyc13300644editdlrm
_unicodefun.cpython-38.pyc32490644editdlrm
_winconsole.cpython-38.pyc75300644editdlrm
__init__.cpython-38.pyc28030644editdlrm
Edit: /opt/alt/python38/lib/python3.8/site-packages/click/__pycache__/formatting.cpython-38.pyc (8581B)
U e([V"@sjddlmZddlmZddlmZddlmZdZddZ d d Z dddZ Gddde Z ddZdS))contextmanager)get_terminal_size) split_opt)term_lenNcCsTi}|D]0}t|D]"\}}t||dt|||<qqtddt|DS)Nrcss|]\}}|VqdS)N).0xyrrA/opt/alt/python38/lib/python3.8/site-packages/click/formatting.py sz measure_table..) enumeratemaxgetrtuplesorteditems)rowswidthsrowidxcolrrr measure_table s rccs,|D]"}t|}|d|t|VqdS)N))rlen)rZ col_countrrrr iter_rowssrNrFc sddlm}|}||||dd}|s2||Sggdfdd}|D]B}|sj|dqVdkrt|} |}| t||qV|g} D]J\} }|d,| r| | |n| ||W5QRXqd | 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)initial_indentsubsequent_indentreplace_whitespaceNc sdsdSddkr<p"dddddfnpFdddfdd=dS)NrT rF )stripappendjoinrbufindentprr _flush_par9s $zwrap_text.._flush_parr#z ) Z _textwrapr expandtabsfill splitlinesrlstripr%Z extra_indentZ indent_onlyr&) textwidthrrpreserve_paragraphsrwrapperr+lineZorig_lenrvrawrr'r wrap_texts:     r7c@s~eZdZdZdddZddZdd Zd d Zd ddZddZ ddZ ddZ d!ddZ e ddZe ddZddZdS)" 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. NcCsV||_|dkrd}|dkr@t}|dkr@tttd|dd}||_d|_g|_dS)NPrr92)indent_increment FORCED_WIDTHrminrr1current_indentbuffer)selfr<r1 max_widthrrr __init__eszHelpFormatter.__init__cCs|j|dS)z1Writes a unicode string into the internal buffer.N)r@r%)rAstringrrr writeqszHelpFormatter.writecCs|j|j7_dS)zIncreases the indentation.Nr?r<rArrr r)uszHelpFormatter.indentcCs|j|j8_dS)zDecreases the indentation.NrFrGrrr dedentyszHelpFormatter.dedentrUsage: cCsd|j||f}|j|j}|t|dkrPdt|}|t||||dnB|||ddt|jt|d}|t||||d|ddS)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. z%*s%s r#)rrr"N)r?r1rrEr7r)rAprogargsprefixZ usage_prefix text_widthr)rrr write_usage}s        zHelpFormatter.write_usagecCs|d|jd|fdS)z!Writes a heading into the buffer.z%*s%s: rN)rEr?)rAZheadingrrr write_headingszHelpFormatter.write_headingcCs|jr|ddS)z#Writes a paragraph into the buffer.r"N)r@rErGrrr write_paragraphszHelpFormatter.write_paragraphc CsBt|j|jd}d|j}|t||||dd|ddS)zaWrites re-indented text into the buffer. This rewraps and preserves paragraphs. r#T)rrr2r"N)rr1r?rEr7)rAr0rOr)rrr write_texts  zHelpFormatter.write_textc Cs,t|}t|}t|dkr$tdt|d||}t|t|D]\}}|d|jd|f|sr|dqDt|||kr|d|t|n|d|d||jt |j |dd}t t || } | r|t| d| D]} |d ||jd| fqqD|dqDd 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. r9z(Expected two columns for definition listrz%*s%srr"r# z%*s%s N)listrr TypeErrorr>rrEr?rrr1iterr7r.next) rArZcol_maxZ col_spacingrZ first_colfirstsecondrOlinesr4rrr write_dls2     zHelpFormatter.write_dlccs4||||z dVW5|XdS)zHelpful context manager that writes a paragraph, a heading, and the indents. :param name: the section name that is written as heading. N)rRrQr)rH)rAnamerrr sections   zHelpFormatter.sectionccs"|z dVW5|XdS)z1A context manager that increases the indentation.N)r)rHrGrrr indentations zHelpFormatter.indentationcCs d|jS)zReturns the buffer contents.r)r&r@rGrrr getvalueszHelpFormatter.getvalue)r9NN)rrI)rUr9)__name__ __module__ __qualname____doc__rCrEr)rHrPrQrRrTr^rr`rarbrrrr r8Ys   %  r8cCshg}d}|D].}t|d}|dkr(d}|t||fq |jddddd 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 rrr zjoin_options..)keyz, css|]}|dVqdS)rNr)rr rrr r szjoin_options..)rr%rsortr&)optionsr5Zany_prefix_is_slashoptrNrrr join_optionss rn)rrrF) contextlibrZtermuirparserr_compatrr=rrr7objectr8rnrrrr s     @