Viewing File: /opt/alt/python35/lib64/python3.5/json/__pycache__/tool.cpython-35.opt-2.pyc
]m @ sS d d l Z d d l Z d d l Z d d l Z d d Z e d k rO e d S) Nc # C sz d } d } t j d | d | } | j d d d d t j d d
| j d d d d t j d d d
| j d d d d d d d | j } | j p t j } | j p t j } | j
} | m y4 | r t j | } n t j | d t
j } Wn1 t k
r7} z t | WYd d } ~ Xn XWd QRX| . t j | | d | d d | j d Wd QRXd S)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.progdescriptioninfilenargs?typehelpz-a JSON file to be validated or pretty-printedoutfilewz%write the output of infile to outfilez--sort-keysaction
store_truedefaultFz5sort the output of dictionaries alphabetically by keyZobject_pairs_hook sort_keysindent
)argparseArgumentParseradd_argumentFileType
parse_argsr sysstdinr stdoutr jsonloadcollectionsOrderedDict
ValueError
SystemExitdumpwrite) r r parseroptionsr r r obje r&