3
[Zp                 @   s:   d Z ddlmZ ddlZddlZdd Zedkr6e  dS )a  Command-line tool to validate and pretty-print JSON

Usage::

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

    )with_statementNc              C   s  t tjdkrtj} tj}nht tjdkrBttjd d} tj}nBt tjdkrrttjd d} ttjd d}nttjd d | B ytj| tj	dd	}W n$ t
k
r   ttj d Y nX W d Q R X |$ tj||dd
dd |jd W d Q R X d S )N      r   wr   z [infile [outfile]]T)Zobject_pairs_hookuse_decimalz    )Z	sort_keysindentr   
)lensysargvstdinstdoutopen
SystemExitjsonloadOrderedDict
ValueErrorexc_infodumpwrite)ZinfileZoutfileobj r   1/usr/lib/python3/dist-packages/simplejson/tool.pymain   s(     r   __main__)__doc__Z
__future__r   r   Z
simplejsonr   r   __name__r   r   r   r   <module>   s   