ó
ŸÙæSc           @€  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(    (    s5   /usr/lib64/python2.7/site-packages/simplejson/tool.pyt   main   s(    		 "t   __main__(   t   __doc__t
   __future__R    R   t
   simplejsonR   R   t   __name__(    (    (    s5   /usr/lib64/python2.7/site-packages/simplejson/tool.pyt   <module>   s   	