Server IP : 192.158.238.246 / Your IP : 18.118.37.224 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib64/python3.7/json/__pycache__/ |
Upload File : |
B YI~d% � @ sf d dl Z d dlZd dlZdd� Zedkrby e� W n. ek r` Z ze�ej� W ddZ[X Y nX dS )� Nc C s� d} d}t j| |d�}|jddt jdd�dd � |jd dt jddd�dd � |jd dddd� |�� }|jpptj}|jp|tj }|j }|�@ yt�|�}W n* t k r� } zt|��W d d }~X Y nX W d Q R X |�" tj|||dd� |�d� W d Q R X d S )Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)�prog�description�infile�?zutf-8)�encodingz-a JSON file to be validated or pretty-printed)�nargs�type�help�outfile�wz%write the output of infile to outfilez--sort-keys� store_trueFz5sort the output of dictionaries alphabetically by key)�action�defaultr � )� sort_keys�indent� )�argparse�ArgumentParser�add_argument�FileType� parse_argsr �sys�stdinr �stdoutr �json�load� ValueError� SystemExit�dump�write) r r �parser�optionsr r r �obj�e� r% �./opt/alt/python37/lib64/python3.7/json/tool.py�main s* $r'