File: //lib/python3.9/site-packages/qrcode/__pycache__/console_scripts.cpython-39.pyc
a
'�b
� @ s� d Z ddlZddlZddlZddlZej�d�r@ddlZe�� dddddd �Z ej
ejejej
d
�Zddd�Zed
kr~e� dS )z�
qr - Convert stdin (or the first argument) to a QR Code.
When stdout is a tty the QR Code is printed to the terminal and when stdout is
a pipe to a file an image is written. The default image format is PNG.
� N)�win�cygwinzqrcode.image.pil.PilImagezqrcode.image.pure.PymagingImagezqrcode.image.svg.SvgImagez!qrcode.image.svg.SvgFragmentImagezqrcode.image.svg.SvgPathImage)ZpilZpymagingZsvgzsvg-fragmentzsvg-path)�L�M�Q�Hc C s� | d u rt jdd � } ddlm} |d�j}tjt�� |d�}|j dd�
d�tt
�� ���d � |j d
tdd� |j d
dtt�� �ddd� |�| �\}} tjt|j d�}|j�rt
�|j|j�}d|vr�|�d� |�dd�\}}t|i g |g�}t||�} nd } | �r| d }
ntt jdt j�}|�� }
|jd u �rF|�|
� n|j|
|jd� | d u �r�t�t j �!� ��r�|j"dd� d S |j#| d�}t j �$� tt j dd �}
|
�s�t j%dk�r�dd l&}|�'t j �!� tj(� t j }
|�)|
� d S )N� r )�get_distribution�qrcode)�usage�versionz --factoryz�Full python path to the image factory class to create the image with. You can use the following shortcuts to the built-in image factory classes: {0}.z, )�helpz
--optimizez�Optimize the data by looking for chunks of at least this many characters that could use a more efficient encoding method. Use 0 to turn off chunk optimization.)�typer
z--error-correction�choicer z^The error correction level to use. Choices are L (7%), M (15%, default), Q (25%), and H (30%).)r �choices�defaultr
)�error_correction�.z+The image factory is not a full python path�buffer)�optimizeT)Ztty)�
image_factory�win32)*�sys�argvZ
pkg_resourcesr r �optparseZOptionParser�__doc__�stripZ
add_option�format�join�sorted�default_factories�keys�intr �
parse_argsr
ZQRCode�factory�get�error�rsplit�
__import__�getattr�stdin�readr Zadd_data�os�isatty�stdout�filenoZprint_asciiZ
make_image�flush�platform�msvcrtZsetmodeZO_BINARYZsave)�argsr r �parserZoptsZqr�module�name�impr �dataZstdin_bufferZimgZ
stdout_bufferr2 � r9 �:/usr/lib/python3.9/site-packages/qrcode/console_scripts.py�main sb
�����
r; �__main__)N)r r r r, r
r1 �
startswithZcolorama�initr ZERROR_CORRECT_LZERROR_CORRECT_MZERROR_CORRECT_QZERROR_CORRECT_Hr r; �__name__r9 r9 r9 r: �<module> s* � �
B