|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib64/python3.7/site-packages/simplejson/__pycache__/ |
Upload File : |
B
VX�Yp � @ s: d Z ddlmZ ddlZddlZdd� Zedkr6e� dS )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 tj�dkrtj} tj}nht tj�dkrBttjd d�} tj}nBt tj�dkrrttjd d�} ttjd d�}nttjd d ��| �B ytj| tj dd �}W n$ t
k
r� tt�� d ��Y nX W d Q R X |�$ tj||dd
dd� |�
d� W d Q R X d S )
N� � �r� �wr z [infile [outfile]]T)Zobject_pairs_hook�use_decimalz )Z sort_keys�indentr �
)�len�sys�argv�stdin�stdout�open�
SystemExit�json�load�OrderedDict�
ValueError�exc_info�dump�write)ZinfileZoutfile�obj� r �B/opt/alt/python37/lib64/python3.7/site-packages/simplejson/tool.py�main s( r �__main__)�__doc__Z
__future__r r Z
simplejsonr r �__name__r r r r �<module> s