o
    j                     @   s   d dl Z d dlZd dlmZ d dlmZ d dlmZmZm	Z	 eeZ
G dd dZe Zddd	d
dddddddddZdd Ze jdd fddZdd ZedkrWe  dS dS )    N)basename)import_module)setup_loggingkeydefaultdictcached_propertyc                   @   s   e Zd Zedd ZdS )_LocalLazyClassc                 C   s8   ddl m}m} ddlm} d| d| d|d j S )Nr   )PYPDFIUM_INFOPDFIUM_INFO)_libsz
pypdfium2 z
pdfium z at Zpdfium)Zpypdfium2.versionr   r	   Zpypdfium2_raw.bindingsr
   _name)selfr   r	   r
    r   W/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pypdfium2_cli/__main__.pyversion_str   s   z_LocalLazyClass.version_strN)__name__
__module____qualname__r   r   r   r   r   r   r      s    r   zRearrange/merge documentsz List/extract/edit embedded fileszExtract imageszExtract textzConvert images to PDFzPrint info on pageobjectsz Print info on document and pageszList a document's fontszDump info about default fontszRasterize pageszTile pages (N-up)zPrint table of contents)Zarrangeattachmentszextract-imageszextract-textZimgtopdfZpageobjectsZpdfinfoZfontszdefault-fontsrenderZtileZtocc           
      C   s   t jdt jdtttjd d}|jdddtj	d |j
d	d
}d }| r)| d p*d }t }|tv rd||= td|dd  }t| }t|dd }|rS|d | n|}|j|||t jd}|| | D ]\}	}|j|	|d qh||fS )NZ	pypdfium2a  pypdfium2 is a Python binding to PDFium, a PDF processing library.
This is the command-line interface. Invoke as `pypdfium2` or `%(py_exe)s -m pypdfium2_cli`.

pypdfium2's CLI mainly serves testing purposes, similar to pdfium_test upstream.
No API stability promises are being made.

Environment variables:
- PYPDFIUM_LOGLEVEL {debug,info,warning,error,critical} = debug
  Controls the logging level.
- DEBUG_AUTOCLOSE {debug,warning,critical} = warning
  How much info to print about (auto-)closing of PDFium objects.
- DEBUG_UNSUPPORTED {0,1} = 1
  Whether to enable or disable the unsupported feature handler.
- DEBUG_SYSFONTS {0,1} = 0
  Whether to install a sysfont listener.)Zpy_exe)progformatter_classdescriptionz-vz	--versionversion)actionr   
subcommand)destr   zpypdfium2_cli.-_ZPARSER_DESCz

)helpr   r   )r   )argparseArgumentParserRawTextHelpFormatterdictr   sys
executableadd_argument	LocalLazyr   add_subparsersSubCommandscopyModuleLoaderreplacegetattr
add_parserattachitems)
argvmain_parserZ
subparsersmodZsc_nameZ	other_scsr   descZ	subparsernamer   r   r   
get_parser*   s<   
r5      c                 C   s6   t | \}}|| }|js|  d S || d S N)r5   
parse_argsr   
print_helpmain)r0   parserr2   argsr   r   r   api_main^   s   
r=   c                   C   s   t   t  d S r7   )r   r=   r   r   r   r   cli_mainj   s   
r>   __main__)r#   r   Zos.pathr   	importlibr   Zpypdfium2_cli._setupr   r   r   r*   r   r&   r(   r5   r0   r=   r>   r   r   r   r   r   <module>   s6   4
