ó
ěUzMc           @   sA   d  Z  d d l Z d d l Z d   Z e d k r= 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˙˙˙˙Nc       	   C   s3  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   y" t j |  d t j	 d	 t
 } Wn t k
 r˙ } t |   n Xt j | | d
 t
 d d d	 t
 | j d  d  S(   Ni   i   t   rbi   t   wbi    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   dumpt   write(   t   infilet   outfilet   objt   e(    (    s3   /usr/lib/python2.7/dist-packages/simplejson/tool.pyt   main   s$    		"t   __main__(   t   __doc__R   t
   simplejsonR   R   t   __name__(    (    (    s3   /usr/lib/python2.7/dist-packages/simplejson/tool.pyt   <module>   s
   	