AlkantarClanX12
Current Path : /opt/alt/python37/lib64/python3.7/json/__pycache__/ |
Current File : //opt/alt/python37/lib64/python3.7/json/__pycache__/tool.cpython-37.opt-2.pyc |
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'