Your IP : 3.17.181.112


Current Path : /opt/alt/python35/lib64/python3.5/json/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/json/__pycache__/tool.cpython-35.opt-1.pyc



��Yfm�@sYdZddlZddlZddlZddlZdd�ZedkrUe�dS)aCommand-line tool to validate and pretty-print JSON

Usage::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

�Nc	#Cszd}d}tjd|d|�}|jddddtj�d	d
�|jddddtjd�d	d
�|jdddddd	d�|j�}|jp�tj}|jp�tj	}|j
}|�my4|r�tj|�}ntj|dt
j�}Wn1tk
r7}zt|��WYdd}~XnXWdQRX|�.tj||d|dd�|jd�WdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.�prog�description�infile�nargs�?�type�helpz-a JSON file to be validated or pretty-printed�outfile�wz%write the output of infile to outfilez--sort-keys�action�
store_true�defaultFz5sort the output of dictionaries alphabetically by keyZobject_pairs_hook�	sort_keys�indent��
)�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr�sys�stdinr	�stdoutr�json�load�collections�OrderedDict�
ValueError�
SystemExit�dump�write)	rr�parserZoptionsrr	r�obj�e�r$�./opt/alt/python35/lib64/python3.5/json/tool.py�mains0!	&r&�__main__)�__doc__rrrrr&�__name__r$r$r$r%�<module>s

?>