
    h                        S r SSKrSSKrSSKrSSKJrJr  SSKJr  SSK	J
r
  SSKrSSKJrJr  \R                  R!                  S5      (       a  SSKr\R$                  " 5         SS	S
SSSS.r\R(                  \R*                  \R,                  \R.                  S.rSS jrS\S\\   4S jrS\4S jrSS\\   S\4S jjr\S:X  a  \" 5         gg)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)NoReturnOptional)Iterable)metadata)	BaseImageDrawerAliases)wincygwinzqrcode.image.pil.PilImagezqrcode.image.pure.PyPNGImagezqrcode.image.svg.SvgImagez!qrcode.image.svg.SvgFragmentImagezqrcode.image.svg.SvgPathImagezqrcode.image.pure.PymagingImage)pilpngsvgzsvg-fragmentzsvg-pathpymaging)LMQHc                   ^ U c  [         R                  SS  n [        R                  " S5      n[        R
                  " [        =(       d    SR                  5       US9mS[        S[        4U4S jjnTR                  SS	[        [        5       S
3S9  TR                  SS[        5        S
3S9  TR                  S[        SS9  TR                  SS[        [         R#                  5       5      SSS9  TR                  SSSS9  TR                  SSS9  TR%                  U 5      u  p0UR&                  (       a7  [        R)                  UR&                  UR&                  5      n [+        U5      nOS n[.        R0                  " [         UR                      WS9nU (       a  U S   nUR3                  SS9nO([         R4                  R6                  R9                  5       nUR:                  c  UR=                  U5        OUR=                  XR:                  S 9  UR>                  (       aA  URA                  5       n	[C        UR>                  S!5       n
U	RE                  U
5        S S S 5        g Ucg  [F        RH                  " [         RJ                  RM                  5       5      (       d  URN                  (       a  URQ                  URN                  (       + S"9  g 0 n[S        URT                  S#S 5      nURV                  (       aZ  U(       d  U" S$5        URV                  U;  a   U" URV                   S%[        U5       35        XRV                     u  pU" S'0 UD6US&'   UR@                  " S'0 UD6n	[         RJ                  RY                  5         U	RE                  [         RJ                  R6                  5        g ! [,         a  nU" [        U5      5         S nAGN]S nAff = f! , (       d  f       g = f)(N   qrcode )usageversionmsgreturnc                 (   > TR                  U 5        e N)error)r   parsers    ^/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/qrcode/console_scripts.pyraise_errormain.<locals>.raise_error3   s    S    z	--factoryzFull 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: .)helpz--factory-drawerzUse an alternate drawer. z
--optimizezOptimize 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$   z--asciiz'Print as ascii even if stdout is piped.
store_true)r$   actionz--outputzLThe output file. If not specified, the image is sent to the standard output.)error_correctionimage_factoryr   surrogateescape)errors)optimizewb)ttydrawer_aliasesz+The selected factory has no drawer aliases.z$ factory drawer not found. Expected module_drawer )-sysargvr   r   optparseOptionParser__doc__stripstrr   
add_optioncommasdefault_factoriesget_drawer_helpintsortedr+   keys
parse_argsfactorygetget_factory
ValueErrorr   QRCodeencodestdinbufferreadr/   add_dataoutput
make_imageopensaveosisattystdoutfilenoasciiprint_asciigetattrr,   factory_drawerflush)argsr   r    optsmoduler,   eqrdataimgoutkwargsaliases
drawer_clsdrawer_kwargsr   s                  @r   mainrg   +   sq   |xx|x(G""'-R)>)>)@'RF   ++12C+D*EQH   ():(;1=   A   ',,./2   A,      ""4(JD||"&&t||T\\B	 '/M 	)$*?*?@#
B
 Aw{{"3{4yy$$&}}
D
D==1{{mmo$++t$HHSM %$  bii

0A0A0C&D&D

NN4::~N.+2.,
 IJ""'1**+ ,!!' 13 )00C0C(D%J&0&A=&AF?#mm%f%

""#]  	 A	 , %$s$   "N, 	O,
O6OO
O#r]   r   c                     SU ;  a  [        S5      eU R                  SS5      u  p[        U 0 0 U/5      n[        X!5      $ )Nr#   z+The image factory is not a full python pathr   )rG   rsplit
__import__rX   )r]   nameimps      r   rF   rF      sE    
&FGG==a(LF
VRdV
,C3r"   c                  Z   0 n [         R                  5        H[  u  p [        U5      n[	        USS 5      nU(       d  M'  U R                  [        U5      [        5       5      nUR                  U5        M]     SR                  S U R                  5        5       5      $ ! [         a     M  f = f)Nr2   z. c              3   J   #    U  H  u  pS [        US5       SU 3v   M     g7f)zFor andz, use: N)r=   ).0rd   	factoriess      r   	<genexpr>"get_drawer_help.<locals>.<genexpr>   s/      ".G vi'(y9".s   !#)
r>   itemsrF   ImportErrorrX   
setdefaultr=   setaddjoin)r$   aliasr]   imagerd   rq   s         r   r?   r?      s    D*002	'E ,35:JD+QOOF7OSU;	e 3 99 "&**,    		s   B
B*)B*rt   c                     [        U 5      n U (       d  g[        U 5      S:X  a  U S   $ SR                  U S S 5       SU SU S    3$ )Nr   r   r   z,  )tuplelenry   )rt   joiners     r   r=   r=      sP    %LE
5zQQxiicr
#$AfXQuRyk::r"   __main__r   )or) r9   r7   rR   r5   typingr   r   collections.abcr   	importlibr   r   qrcode.image.baser   r   platform
startswithcoloramainitr>   ERROR_CORRECT_LERROR_CORRECT_MERROR_CORRECT_QERROR_CORRECT_Hr+   rg   r;   r%   rF   r?   r=   __name__r4   r"   r   <module>r      s     	 
 % $   6 <<,--MMO ')&7/1  
												 b$J Y  &;(3- ; ; zF r"   