
P'^c           @  sQ   d  Z  d d l m Z d d l Z d d l Z d   Z e d k rM e   n  d S(   s  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)

i(   t   with_statementNc          C  sU  t  t j  d k r* t j }  t j } n t  t j  d k ra t t j d d  }  t j } n[ t  t j  d k r t t j d d  }  t t j d d  } n t t j d d   |  Q y" t j |  d t j	 d	 t
 } Wn' t k
 rt t j   d   n XWd  QX| 4 t j | | d
 t
 d d d	 t
 | j d  Wd  QXd  S(   Ni   i   t   ri   t   wi    s    [infile [outfile]]t   object_pairs_hookt   use_decimalt	   sort_keyst   indents       s   
(   t   lent   syst   argvt   stdint   stdoutt   opent
   SystemExitt   jsont   loadt   OrderedDictt   Truet
   ValueErrort   exc_infot   dumpt   write(   t   infilet   outfilet   obj(    (    s1   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tool.pyt   main   s(    		 "t   __main__(   t   __doc__t
   __future__R    R   t
   simplejsonR   R   t   __name__(    (    (    s1   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tool.pyt   <module>   s   	