
     h
                     l   d dl mZ d dlZd dlmZ d dlmZ d dlmZm	Z	 d dl
mZmZmZ d dlmZ d dlmZmZmZ d	d
gZdej        dedefdZ ej        dd	           ej        de           ej        d ej        dd                     ej        de           ej        de           ej        ddde           ej        dddedd           ej        d d!de          ej        d"                                                                                                             ZdS )#    )OptionalN)cli_root)	CLIConfig)DEFAULT_CONFIG_FILEpyhanko_exception_manager)_index_pageloggerreadable_file)ConfigurationError)QRStampStyleqr_stamp_filetext_stamp_filestampselect_stylectx
style_nameurlc                    | j         j        }|sd S |st          j        dt           d          	 |                    |          }nB# t          $ r5}d| d}t          j        ||           t          j        |          d }~ww xY w|r)t          |t                    st          j        d          |s)t          |t                    rt          j        d          |S )Nz2Using stamp styles requires a configuration file (z by default).z4Configuration problem. Are you sure that the style 'z0' is properly defined in the configuration file?)exc_infozAThe --stamp-url parameter is only meaningful for QR stamp styles.z/QR stamp styles require the --stamp-url option.)objconfigclickClickExceptionr   get_stamp_styler   r	   error
isinstancer   )r   r   r   
cli_configstyleemsgs          V/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/pyhanko/cli/commands/stamp.pyr   r      s:   &)gnJ t 
"3#3 3 3
 
 	
(**:66 ( ( (MM M M 	 	S1%%%%"3'''(  
:e\22 
"O
 
 	
  
Z|44 
"=
 
 	
 Ls   A 
B0BBzstamp PDF files)helpnameinfile)typeoutfileTF)writabledir_okayxyz--style-namez%stamp style name for stamp appearance)r"   requiredr%   z--pagez)page on which the stamp should be applied   )r"   r+   r%   defaultshow_defaultz--stamp-urlz$QR code URL to use in QR stamp stylec           
          t                      5  t          | ||          }t          |          }	|rt          ||||	|||           nt	          ||||	||           d d d            d S # 1 swxY w Y   d S )N)	dest_pager)   r*   r   )r0   r)   r*   )r   r   r   r   r   )
r   r$   r&   r)   r*   r   page	stamp_urlstamp_stylepage_ixs
             r!   r   r   0   s    6 
#	$	$  "3
I>>d## 	!     1                    s   AA++A/2A/)typingr   r   pyhanko.cli._rootr   pyhanko.cli.configr   pyhanko.cli.runtimer   r   pyhanko.cli.utilsr   r	   r
   pyhanko.config.errorsr   pyhanko.stampr   r   r   __all__Contextstrr   commandargumentPathintoptionpass_contextr        r!   <module>rG      s9          & & & & & & ( ( ( ( ( ( N N N N N N N N @ @ @ @ @ @ @ @ @ @ 4 4 4 4 4 4 F F F F F F F F F FN
#em  3    B (w777}---	

D5 I I IJJJ##	0		   	4	   	/		           KJ .- 874  rF   