
    KiE                         d dl Z d dlZd dlZd dlZd dlZddlmZmZmZ ddl	m
Z
 ddZd Zedk    r e             dS dS )	    N   )LatexWalker	disp_nodemake_json_encoder)version_strc           	         | t           j        dd          } t          j        dd          }|                    ddddd	gdd
           |                    dddt
          dd           |                    dddd d           |                    dddddt          j                   |                    ddddt          j                   |                    ddddd           |                    ddddd            |                    d!ddd"dt          j                   |                    d#ddd"t          j                   |                    d$d%d&dt          j        t          j	        d'(           |                    d)d*d&dt          j
        d+           |                    d,d-d.                    t                    d/0           |                    d1d2d34           |                    d5d6d7d d8d9:           |                    d;d<d=d>?           |                    |           }t          j                     t          j                                        |j                   t          j        t$                    }d@}|j        r8|j        r)|                    dA           t          j        d           |j        }n"t/          j        |j        B          D ]}||z  }t3          ||j        |j        C          }|                                \  }}}	|j        dk    r4t=          dD           |D ]}
t?          |
           t=          dE           d S |j        d	k    rWtA          j!        dF|it           j"        tG          |          |j$        G           t           j"        %                    dH           d S tM          dI|j        z             )JN   latexwalkerF)progadd_helpz--output-formatFORMAToutput_formathumanjsonz=Requested output format for the node tree ("human" or "json"))metavardestchoicesdefaulthelpz--json-indent	NUMSPACESjson_indentr   zKIndentation in JSON output (specify number of spaces per indentation level))r   r   typer   r   z--json-compactstore_constzOutput compact JSON)r   actionconstr   z--keep-inline-mathTkeep_inline_math)r   r   r   r   r   z--no-keep-inline-math)r   r   r   r   z--tolerant-parsingtolerant_parsing)r   r   r   r   z--no-tolerant-parsingzJTolerate syntax errors when parsing, and attempt to continue (default yes)z--strict-bracesstrict_bracesz--no-strict-bracesz-qz--quietlogging_levelzSuppress warning messages)r   r   r   r   r   z-vz	--verbosezVerbose outputz	--versionversionzpylatexenc {}z!Show version information and exit)r   r    r   z--helpr   z#Show this help information and exit)r   r   z--codez-cstore
LATEX_CODEzConvert the given LATEX_CODE to unicode text instead of reading from FILE or standard input.  You cannot specify FILEs if you use this option, and any standard input is ignored.)r   r   r   r   filesFILE*z:Input files (if none specified, read from stdandard input))r   nargsr    zTCannot specify both FILEs and --code option. Use --help option for more information.)r#   )r   r   z
--- NODES ---
z
-------------
nodelist)clsindent
zInvalid output format: )'sysargvargparseArgumentParseradd_argumentintSUPPRESSloggingERRORINFODEBUGformatr   
parse_argsbasicConfig	getLoggersetLevelr   __name__coder#   errorexit	fileinputinputr   r   r   get_latex_nodesr   printr   r   dumpstdoutr   r   write
ValueError)r-   parserargsloggerlatexliner
   r(   poslen_ns              w/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/pylatexenc/latexwalker/__main__.pymainrQ   &   s   |x|$-%HHHF
)8/!(& 17\  ^ ^ ^ = !1  2 2 2 (}]Z^2  4 4 4 ,]$/%.  0 0 0 /U/%.  0 0 0 ,]$/  ? ? ?
/U/4  5 5 5 )-t,e%.  0 0 0 ,]%,%.  0 0 0
 iom%mW\8  : : : k%m-  / / / I / 6 6{ C C@  B B B B  D D D $wlE  F F F
 sY  [ [ [ T""D  !3444x((FEy : 	LL C D D DHQKKK	O$*555 	 	DTMEEe/3/D,0,>@ @ @K (7799XsDW$$!""" 	 	AaLLLL!"""V##	J+*'44)	+ 	+ 	+ 	+ 	

.t/AA
B
BB    c                      	 t                       d S # t          $ r   dd l} dd l}|                                 |                                  Y d S xY w)Nr   )rQ   
SystemExitpdb	traceback	print_excpost_mortem)rU   rV   s     rP   run_mainrY      sr    
   


s	    <A__main__)N)r,   r@   r.   r   r3   r
   r   r   r   r    r   rQ   rY   r<    rR   rP   <module>r\      s   4 


        D C C C C C C C C C ! ! ! ! ! !dC dC dC dCP    z 	DFFFFF rR   