404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.139.235.59: ~ $
3

��X~K�@sdZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZddlmZmZmZmZmZmZddlmZdd	lmZmZdd
lmZmZm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&m'Z'dd
l(m)Z)m*Z*dZ+dd�Z,dd�Z-dd�Z.dd�Z/dd�Z0ej1fdd�Z2dS)z�
    pygments.cmdline
    ~~~~~~~~~~~~~~~~

    Command line interface.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�print_functionN)�dedent)�__version__�	highlight)�
ClassNotFound�OptionError�docstring_headline�guess_decode�guess_decode_from_terminal�terminal_encoding)�get_all_lexers�get_lexer_by_name�guess_lexer�load_lexer_from_file�get_lexer_for_filename�find_lexer_class_for_filename)�	TextLexer)�LatexEmbeddedLexer�LatexFormatter)�get_all_formatters�get_formatter_by_name�load_formatter_from_file�get_formatter_for_filename�find_formatter_class)�TerminalFormatter)�get_all_filters�find_filter_class)�get_all_styles�get_style_by_namea�Usage: %s [-l <lexer> | -g] [-F <filter>[:<options>]] [-f <formatter>]
          [-O <options>] [-P <option=value>] [-s] [-v] [-x] [-o <outfile>] [<infile>]

       %s -S <style> -f <formatter> [-a <arg>] [-O <options>] [-P <option=value>]
       %s -L [<which> ...]
       %s -N <filename>
       %s -H <type> <name>
       %s -h | -V

Highlight the input file and write the result to <outfile>.

If no input file is given, use stdin, if -o is not given, use stdout.

If -s is passed, lexing will be done in "streaming" mode, reading and
highlighting one line at a time.  This will only work properly with
lexers that have no constructs spanning multiple lines!

<lexer> is a lexer name (query all lexer names with -L). If -l is not
given, the lexer is guessed from the extension of the input file name
(this obviously doesn't work if the input is stdin).  If -g is passed,
attempt to guess the lexer from the file contents, or pass through as
plain text if this fails (this can work for stdin).

Likewise, <formatter> is a formatter name, and will be guessed from
the extension of the output file name. If no output file is given,
the terminal formatter will be used by default.

The additional option -x allows custom lexers and formatters to be
loaded from a .py file relative to the current working directory. For
example, ``-l ./customlexer.py -x``. By default, this option expects a
file with a class named CustomLexer or CustomFormatter; you can also
specify your own class name with a colon (``-l ./lexer.py:MyLexer``).
Users should be very careful not to use this option with untrusted files,
because it will import and run them.

With the -O option, you can give the lexer and formatter a comma-
separated list of options, e.g. ``-O bg=light,python=cool``.

The -P option adds lexer and formatter options like the -O option, but
you can only give one option per -P. That way, the option value may
contain commas and equals signs, which it can't with -O, e.g.
``-P "heading=Pygments, the Python highlighter".

With the -F option, you can add filters to the token stream, you can
give options in the same way as for -O after a colon (note: there must
not be spaces around the colon).

The -O, -P and -F options can be given multiple times.

With the -S option, print out style definitions for style <style>
for formatter <formatter>. The argument given by -a is formatter
dependent.

The -L option lists lexers, formatters, styles or filters -- set
`which` to the thing you want to list (e.g. "styles"), or omit it to
list everything.

The -N option guesses and prints out a lexer name based solely on
the given filename. It does not take input or highlight anything.
If no specific lexer can be determined "text" is returned.

The -H option prints detailed help for the object <name> of type <type>,
where <type> is one of "lexer", "formatter" or "filter".

The -s option processes lines one at a time until EOF, rather than
waiting to process the entire file.  This only works for stdin, and
is intended for streaming input such as you get from 'tail -f'.
Example usage: "tail -f sql.log | pygmentize -s -l sql"

The -v option prints a detailed traceback on unhandled exceptions,
which is useful for debugging and bug reports.

The -h option prints this help.
The -V option prints the package version.
c
Cs�i}|s|Sx�|D]x}|j�s q|jd�}x^|D]V}|j�}y$|jdd�\}}|j�}|j�}Wntk
r|d||<Yq0X|||<q0WqW|S)N�,�=�T)�strip�split�
ValueError)Zo_strs�optsZo_strZo_argsZo_argZo_keyZo_val�r&�/usr/lib/python3.6/cmdline.py�_parse_optionsns"


r(cCsZg}|s|SxH|D]@}d|krD|jdd�\}}|j|t|g�f�q|j|if�qW|S)N�:r!)r#�appendr()Zf_strs�filtersZf_str�fname�foptsr&r&r'�_parse_filters�s
r.cCs�y�|dkr0t|�}td|j�tt|j��nX|dkr^t|�}td|j�tt|j��n*|dkr�t|�}td|�tt|j��dSttfk
r�td|t	j
d	�d
SXdS)N�lexerzHelp on the %s lexer:�	formatterzHelp on the %s formatter:�filterzHelp on the %s filter:rz
%s not found!)�filer!)r
�print�namer�__doc__rr�AttributeErrorr$�sys�stderr)�whatr4�clsr&r&r'�_print_help�s"r;cCs�|dkr�t�td�td�g}xJt�D]@\}}}}dj|�d||rZddj|�dp\df}|j|�q*W|j�x|D]}td	|�q|W�nR|d
k�r0t�td�td�g}xPt�D]F}t|�}	dj|j�d|	|jr�ddj|j�dp�df}|j|�q�W|j�x�|D]}td	|��qWn�|d
k�r�t�td�td�x�t	�D].}
t
|
�}td|
d�tdt|���qXWnZ|dk�r�t�td�td�x8t�D].}
t|
�}td|
d�tdt|���q�WdS)Nr/zLexers:z~~~~~~~z, r)z(filenames �)�z* %s
    %s %sr0zFormatters:z~~~~~~~~~~~r1zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
r3r�joinr*�sortrr�aliases�	filenamesrrrr)r9�info�fullname�namesZexts�_�tup�ir:�docr4r&r&r'�_print_list�sR




rJc*{Cs�	i}g}g}g}xR|D]J\}}|dkr2|j|�n&|dkrF|j|�n|dkrX|j|�|||<qW|jdd�dk	r�t|�dS|jdd�dk	r�tdt�dS|jdd�}	|	dk	�r|r�t|tjd	�d
Stddg�|s�dd
ddg}x|D]}t|jd��q�WdS|jdd�}
|
dk	�rr|�s2t	|�d
k�rDt|tjd	�d
S|\}}|d5k�rht|tjd	�d
St
||�St|�}
|jdd�xJ|D]B}y|jdd�\}}Wnt
k
�r�d|
|<Yn
X||
|<�q�W|jdd�|
jd|
jd��}|
jd|
jd��}|jdd�}|dk	�r@t|�}|dk�r.t}t|jd�dS|jdd�}|jdd�}|dk	�r|jdd�}|�s�t|tjd	�d
S|�s�|�r�t|tjd	�d
Sy||
d<t|f|
�}Wn0tk
�r�}zt|tjd	�dSd}~XnXt|j|�p�d��dS|dk	�r"t|tjd	�d
St|�}|jdd�d}|jdd�dk	�rPd}d}|jdd�}|�r.|�r�d|k�r�y:d |k�r�|jd d�\}}t||f|
�}nt|f|
�}Wn2tk
�r�}ztd!|tjd	�dSd}~XnXnHyt|f|
�}Wn6ttfk
�r,}ztd!|tjd	�dSd}~XnXd}|�r�t	|�dk�rXt|tjd	�d
Sd"|k�rttd#tjd	�d
S|d}y"t|d$��}|j�}WdQRXWn2tk
�r�}ztd%|tjd	�dSd}~XnX|�s�t|�\}}|�s<yt||f|
�}Wn�tk
�rr}zXd&|k�rNyt|f|
�}Wn tk
�rJtf|
�}YnXntd!|tjd	�dSWYdd}~Xn2tk
�r�}ztd!|tjd	�dSd}~XnXn�d"|k�r$tj d6k�r�tj!j"j�}n
tj!j�}|�s�t#|tj!�\}}|�s<yt|f|
�}Wn tk
�r tf|
�}YnXn|�s<td(tjd	�d
SxX|D]P\}}y|j$|f|�Wn2tk
�r�}ztd!|tjd	�dSd}~XnX�qBW|jd)d�} |jdd�}|�r||�r4d|k�r4y:d |k�r�|jd d�\}!}"t%|!|"f|
�}nt%|f|
�}Wn2tk
�r0}ztd!|tjd	�dSd}~XnXnHyt|f|
�}Wn6ttfk
�rz}ztd!|tjd	�dSd}~XnX| �r|�s�yt&| f|
�}Wn6ttfk
�r�}ztd!|tjd	�dSd}~XnXyt| d*�}#Wn2tk
�r}ztd+|tjd	�dSd}~XnXn,|�s$t'f|
�}tj d7k�r:tj(j"}#ntj(}#|�s`| �rT||_)nt*tj(�|_)| �r�tj+d8k�r�|j,d9k�r�tj d:k�r�dd0l-m.}$|$|#|j)d1�}#d|_)yddl/}%Wnt0k
�r�YnX|%j1j2|#ddddd2�}#|
jd3d�}&t	|&�d
k�	r(t3|t4��	r(|&d}'|&d}(t5|'|(|�}d"|k�	rDt6||||#�dSypxjtj d;k�	rbtj!j"j7�})n
tj!j7�})|)�	stP|�	s�t#|)tj!�d})t6|)|||#�t8|#d4��	rH|#j9��	qHWdSt:k
�	r�dSXdS)<Nz-Oz-Pz-Fz-hrz-Vz3Pygments version %s, (c) 2006-2017 by Georg Brandl.z-L)r2�r=r/r0r1r>�sz-Hr r!T�
inencoding�encoding�outencodingz-Nz-Sz-az-fFz-xz-lz.pyr)zError:z-sz5Error: -s option not usable when input file specified�rbzError: cannot read infile:z-g�z7Error: when using -s a lexer has to be selected with -lz-o�wbzError: cannot open outfile:�win32�cygwin�Terminal�Terminal256)�UnclosingTextIOWrapper)rN)Zconvertr"Z	autoresetZwrap�escapeinside�flush)r/r0r1)rQ)rQ)rSrT)rUrV)rQ)rQ);r*�popr3rr7r8�mainrJ�rstrip�lenr;r(r#r$�getrrrArrZget_style_defsr.�rsplitrr
r�open�read�	Exceptionr	rr�version_info�stdin�bufferr
Z
add_filterrrr�stdoutrNr�platformr4�
pygments.utilrWZcolorama.initialise�ImportErrorZ
initialiseZwrap_stream�
isinstancerrr�readline�hasattrrY�KeyboardInterrupt)*�popts�args�usager%ZO_optsZP_optsZF_opts�opt�argZL_optZH_optr9r4Zparsed_optsZp_opt�valuerMrOZinfnr/ZS_optZa_optZf_optZfmter�errZallow_custom_lexer_formatterZ	lexername�filename�codeZinfpr,r-Zoutfnr2Z	fmternameZoutfilerWZcoloramarX�left�right�liner&r&r'�
main_inner�s�






















rzcCs|t|dfd}ytj|dd�d�\}}Wn$tjk
rRt|tjd�dSXyt|||�Stk
�rvdt|�kr�ttjd�td	d
tjd�tdtjd�tdtjd�td
tjd�td	d
tjd�ttjd��ddl	}|j
tj��}|dj�}t
|�dk�r<|d|djd�dj�dd�7}ttjd�tdtjd�t|tjd�tdtjd�dSXdS)z(
    Main command line entry point.
    r�r!Nzl:f:F:o:O:P:LS:a:N:vhVHgsx)r2rKz-v�*�Az3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz8<https://bitbucket.org/birkenfeld/pygments-main/issues>.rQz	
   (f%s)�
z*** Error while highlighting:z>*** If this is a bug you want to report, please rerun with -v.������)�USAGE�getoptZGetoptErrorr3r7r8rzrb�dict�	traceback�format_exception�exc_infor"r]r#)rorprnr�rC�msgr&r&r'r[s@


&
r[)3r5Z
__future__rr7r��textwraprZpygmentsrrrhrrrr	r
rZpygments.lexersrr
rrrrZpygments.lexers.specialrZpygments.formatters.latexrrZpygments.formattersrrrrrZpygments.formatters.terminalrZpygments.filtersrrZpygments.stylesrrr�r(r.r;rJrz�argvr[r&r&r&r'�<module>
s,  N
3=

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 2.98 KB 0644
__init__.cpython-36.pyc File 2.98 KB 0644
cmdline.cpython-36.opt-1.pyc File 12.1 KB 0644
cmdline.cpython-36.pyc File 12.1 KB 0644
console.cpython-36.opt-1.pyc File 1.85 KB 0644
console.cpython-36.pyc File 1.85 KB 0644
filter.cpython-36.opt-1.pyc File 2.54 KB 0644
filter.cpython-36.pyc File 2.54 KB 0644
formatter.cpython-36.opt-1.pyc File 2.86 KB 0644
formatter.cpython-36.pyc File 2.86 KB 0644
lexer.cpython-36.opt-1.pyc File 22.95 KB 0644
lexer.cpython-36.pyc File 23.56 KB 0644
modeline.cpython-36.opt-1.pyc File 1.09 KB 0644
modeline.cpython-36.pyc File 1.09 KB 0644
plugin.cpython-36.opt-1.pyc File 1.94 KB 0644
plugin.cpython-36.pyc File 1.94 KB 0644
regexopt.cpython-36.opt-1.pyc File 2.73 KB 0644
regexopt.cpython-36.pyc File 2.73 KB 0644
scanner.cpython-36.opt-1.pyc File 3.38 KB 0644
scanner.cpython-36.pyc File 3.38 KB 0644
sphinxext.cpython-36.opt-1.pyc File 4.38 KB 0644
sphinxext.cpython-36.pyc File 4.38 KB 0644
style.cpython-36.opt-1.pyc File 3.61 KB 0644
style.cpython-36.pyc File 3.66 KB 0644
token.cpython-36.opt-1.pyc File 4.14 KB 0644
token.cpython-36.pyc File 4.14 KB 0644
unistring.cpython-36.opt-1.pyc File 25.67 KB 0644
unistring.cpython-36.pyc File 25.67 KB 0644
util.cpython-36.opt-1.pyc File 10.27 KB 0644
util.cpython-36.pyc File 10.27 KB 0644