File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/__pycache__/cli.cpython-310.pyc
Back
o �h � @ sR d Z ddlZddlZddlmZ ddlZddlmZ dd� Zdd� Z dd d �Z dS )ae Module that contains the command line app. Why does this file exist, and why not put this in __main__? You might be tempted to import things from __main__ later, but that will cause problems: the code will get executed twice: - When you run `python -m sqlparse` python will execute ``__main__.py`` as a script. That means there won't be any ``sqlparse.__main__`` in ``sys.modules``. - When you import __main__ it will get executed again (as a module) because there's no ``sqlparse.__main__`` in ``sys.modules``. Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration � N)� TextIOWrapper)� SQLParseErrorc C s� g d�} t jdddd�}|�d� |jddd d dd� |jd dtjd� |�d�}|jdddd| d�d�dd� | D ���d� |jdddd| d�d�dd� | D ���d� |jdd d!d"d#d$gd%d� |jd&d'd(d)d*d+� |jd,d-d.d(d)d/d+� |jd0d1d2td3d4� |jd5d6d(d)d7d+� |jd8d9d(d)d:d+� |jd;d<d(d)d=d>� |jd?d@d(d)dAd>� |jdBdCdDtdEd4� |jdFdGd)t dHd4� |jdIdJd)t dKd4� |jdLdMdNdOdP� |S )QN)�upper�lower� capitalize� sqlformatzEFormat FILE according to OPTIONS. Use "-" as FILE to read from stdin.z%(prog)s [OPTIONS] FILE, ...)�prog�description�usage�filenamez-oz --outfile�outfile�FILEz)write output to FILE (defaults to stdout))�dest�metavar�helpz --version�version)�actionr zFormatting Optionsz-kz --keywords�CHOICE�keyword_casez,change case of keywords, CHOICE is one of {}z, c s � � | ]}d � |�V qdS �z"{}"N��format��.0�x� r �?/usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/cli.py� <genexpr>? � � z create_parser.<locals>.<genexpr>)r r �choicesr z-iz --identifiers�identifier_casez/change case of identifiers, CHOICE is one of {}c s r r r r r r r r G r z-lz --language�LANG� output_format�python�phpzJoutput a snippet in programming language LANG, choices are "python", "php"z--strip-comments�strip_comments� store_trueFzremove comments)r r �defaultr z-rz --reindent�reindentzreindent statementsz--indent_width�indent_width� z(indentation width (defaults to 2 spaces))r r( �typer z--indent_after_first�indent_after_firstz2indent after first line of statement (e.g. SELECT)z--indent_columns�indent_columnsz<indent all columns by indent_width instead of keyword lengthz-az--reindent_alignedz%reindent statements to aligned format)r r( r z-sz--use_space_around_operatorsz*place spaces around mathematical operatorsz--wrap_after� wrap_afterr z*Column after which lists should be wrappedz --comma_first�comma_firstz-Insert linebreak before comma (default False)z --compact�compactz2Try to produce more compact output (default False)z --encoding�encodingzutf-8z*Specify the input encoding (default utf-8))r r( r ) �argparse�ArgumentParser�add_argument�sqlparse�__version__�add_argument_groupr �join�int�bool)� _CASE_CHOICES�parser�groupr r r � create_parser s� � �� ����������������r? c C s t j�d�| �� dS )z5Print msg and optionally exit with return code exit_.z[ERROR] {} � )�sys�stderr�writer )�msgr r r �_error� s rE c C s� t � }|�| �} | jdkr&ttjj| jd�}z |�� }W |� � nB|� � w z!t | j| jd��}d�|�� �}W d � n1 sAw Y W n t yb } ztd�| j|��W Y d }~S d }~ww d}| jr�z t | jd| jd�}d}W n t y� } ztd�| j|��W Y d }~S d }~ww tj}t| �}ztj�|�}W n ty� } z td �|��W Y d }~S d }~ww tj|fi |��} |�| � |�� |r�|�� d S )N�-)r2 � zFailed to read {}: {}F�wTzFailed to open {}: {}zInvalid options: {}r )r? � parse_argsr r rA �stdin�bufferr2 �read�detach�openr9 � readlines�OSErrorrE r r �stdout�varsr6 � formatter�validate_optionsr rC �flush�close) �argsr= �wrapper�data�f�e�close_stream�stream�formatter_opts�sr r r �main� sR ��������� r` )N)�__doc__r3 rA �ior r6 �sqlparse.exceptionsr r? rE r` r r r r �<module> s ~
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings