§
    -áUg  ã                   óN   — d Z ddlZddlZddlmZ ddlZddlmZ d„ Zd„ Z	dd„Z
dS )	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                  óÒ  — g d¢} t          j        ddd¬¦  «        }|                     d¦  «         |                     ddd	d
d¬¦  «         |                     ddt          j        ¬¦  «         |                     d¦  «        }|                     dddd| d                     d                     d„ | D ¦   «         ¦  «        ¦  «        ¬¦  «         |                     dddd| d                     d                     d„ | D ¦   «         ¦  «        ¦  «        ¬¦  «         |                     ddd d!d"d#gd$¬¦  «         |                     d%d&d'd(d)¬*¦  «         |                     d+d,d-d'd(d.¬*¦  «         |                     d/d0d1t          d2¬3¦  «         |                     d4d5d'd(d6¬*¦  «         |                     d7d8d'd(d9¬*¦  «         |                     d:d;d'd(d<¬=¦  «         |                     d>d?d'd(d@¬=¦  «         |                     dAdBdCt          dD¬3¦  «         |                     dEdFd(t          dG¬3¦  «         |                     dHdId(t          dJ¬3¦  «         |                     dKdLdMdN¬O¦  «         |S )PN)Ú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   zFormatting Optionsz-kz
--keywordsÚCHOICEÚkeyword_casez,change case of keywords, CHOICE is one of {}z, c              3   ó@   K  — | ]}d                       |¦  «        V — ŒdS ©z"{}"N©Úformat©Ú.0Úxs     úK/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/sqlparse/cli.pyú	<genexpr>z create_parser.<locals>.<genexpr>?   ó.   è è € Ð>Ð>¨1�f—m’m AÑ&Ô&Ð>Ð>Ð>Ð>Ð>Ð>ó    )r   r   Úchoicesr   z-iz--identifiersÚidentifier_casez/change case of identifiers, CHOICE is one of {}c              3   ó@   K  — | ]}d                       |¦  «        V — ŒdS r   r   r   s     r   r   z create_parser.<locals>.<genexpr>G   r    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_trueFzremove comments)r   r   Údefaultr   z-rz
--reindentÚreindentzreindent 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Úencodingzutf-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Úgroups      r   Úcreate_parserrB       sµ  € Ø4Ð4Ð4€MåÔ$Øð*à-ð	ñ ô €Fð ×Ò˜
Ñ#Ô#Ð#à
×ÒØˆkØØØ8ð	 ñ :ô :ð :ð ×ÒØØÝÔ$ð ñ &ô &ð &ð
 ×%Ò%Ð&:Ñ;Ô;€Eà	×ÒØˆlØØØØ;×BÒBØ�IŠIÐ>Ð>°Ð>Ñ>Ô>Ñ>Ô>ñ@ô @ð ñ Aô Að Að 
×ÒØˆoØØØØ>×EÒEØ�IŠIÐ>Ð>°Ð>Ñ>Ô>Ñ>Ô>ñ@ô @ð ñ Aô Að Að 
×ÒØˆlØØØ˜5Ð!ð+ð ñ ,ô ,ð ,ð 
×ÒØØØØØð ñ  ô  ð  ð 
×ÒØˆlØØØØ"ð ñ $ô $ð $ð 
×ÒØØØÝØ7ð ñ 9ô 9ð 9ð 
×ÒØØ!ØØØAð ñ Cô Cð Cð 
×ÒØØØØØKð ñ Mô Mð Mð 
×ÒØÐ"ØØØ4ð	 ñ 6ô 6ð 6ð 
×ÒØÐ,ØØØ9ð	 ñ ;ô ;ð ;ð 
×ÒØØØÝØ9ð ñ ;ô ;ð ;ð 
×ÒØØØÝØ<ð ñ >ô >ð >ð 
×ÒØØØÝØAð ñ Cô Cð Cð 
×ÒØØØØ9ð	 ñ ;ô ;ð ;ð €Mr!   c                 ój   — t           j                             d                     | ¦  «        ¦  «         dS )z5Print msg and optionally exit with return code exit_.z[ERROR] {}
é   )ÚsysÚstderrÚwriter   )Úmsgs    r   Ú_errorrI   ž   s+   € å„J×Ò�^×*Ò*¨3Ñ/Ô/Ñ0Ô0Ð0Øˆ1r!   c                 óÄ  — t          ¦   «         }|                     | ¦  «        } | j        dk    rht          t          j        j        | j        ¬¦  «        }	 |                     ¦   «         }| 	                    ¦   «          n´# | 	                    ¦   «          w xY w	 t          | j        | j        ¬¦  «        5 }d                     |                     ¦   «         ¦  «        }d d d ¦  «         n# 1 swxY w Y   n?# t          $ r2}t          d                     | j        |¦  «        ¦  «        cY d }~S d }~ww xY wd}| j        r_	 t          | j        d| j        ¬¦  «        }d}nK# t          $ r2}t          d                     | j        |¦  «        ¦  «        cY d }~S d }~ww xY wt          j        }t%          | ¦  «        }	 t&          j                             |¦  «        }n9# t,          $ r,}t          d	                     |¦  «        ¦  «        cY d }~S d }~ww xY wt'          j        |fi |¤Ž}	|                     |	¦  «         |                     ¦   «          |r|                     ¦   «          d
S )Nú-)r5   Ú zFailed to read {}: {}FÚwTzFailed to open {}: {}zInvalid options: {}r   )rB   Ú
parse_argsr   r   rE   ÚstdinÚbufferr5   ÚreadÚdetachÚopenr<   Ú	readlinesÚOSErrorrI   r   r   ÚstdoutÚvarsr9   Ú	formatterÚvalidate_optionsr   rG   ÚflushÚclose)
Úargsr@   ÚwrapperÚdataÚfÚeÚclose_streamÚstreamÚformatter_optsÚss
             r   Úmainre   ¤   sÇ  € Ý‰_Œ_€FØ×Ò˜TÑ"Ô"€Dà„}˜ÒÐÝ¥¤	Ô 0¸4¼=ÐIÑIÔIˆð	Ø—<’<‘>”>ˆDà�NŠNÑÔÐÐøˆG�NŠNÑÔÐÐøøøð	BÝ�d”m¨d¬mÐ<Ñ<Ô<ð .ÀØ—w’w˜qŸ{š{™}œ}Ñ-Ô-�ð.ð .ð .ñ .ô .ð .ð .ð .ð .ð .ð .øøøð .ð .ð .ð .øøåð 	Bð 	Bð 	BÝØ'×.Ò.¨t¬}¸aÑ@Ô@ñBô Bð Bð Bð Bð Bð Bð Bøøøøð	Bøøøð €LØ„|ð ð	KÝ˜$œ,¨°d´mÐDÑDÔDˆFØˆLˆLøÝð 	Kð 	Kð 	KÝÐ1×8Ò8¸¼ÀqÑIÔIÑJÔJÐJÐJÐJÐJÐJÐJøøøøð	Køøøõ ”ˆå˜$‘Z”Z€Nð7Ý!Ô+×<Ò<¸^ÑLÔLˆˆøÝð 7ð 7ð 7ÝÐ+×2Ò2°1Ñ5Ô5Ñ6Ô6Ð6Ð6Ð6Ð6Ð6Ð6øøøøð7øøøõ 	Œ˜Ð/Ð/ Ð/Ð/€AØ
‡L‚L��O„O€OØ
‡L‚L�N„N€NØð Ø�Š‰ŒˆØˆ1sŠ   ÁA> Á>BÂC3 Â3(C'ÃC3 Ã'C+Ã+C3 Ã.C+Ã/C3 Ã3
D/Ã='D*Ä$D/Ä*D/Ä<E Å
FÅ%'FÆFÆFÆ6G Ç
HÇ !HÈHÈH)N)Ú__doc__r6   rE   Úior   r9   Úsqlparse.exceptionsr   rB   rI   re   © r!   r   ú<module>rj      s�   ððð ð €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à €€€Ø -Ð -Ð -Ð -Ð -Ð -ð
{ð {ð {ð|ð ð ð'ð 'ð 'ð 'ð 'ð 'r!   