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 pdfium)pypdfium2.versionr   r	   pypdfium2_raw.bindingsr
   _name)selfr   r	   r
    r   \/var/www/html/fyndo/pharma/fyndo/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)arrangeattachmentszextract-imageszextract-textimgtopdfpageobjectspdfinfofontszdefault-fontsrendertile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 )N	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.)py_exe)progformatter_classdescriptionz-vz	--versionversion)actionr$   
subcommand)destr   zpypdfium2_cli.-_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_parser
subparsersmodsc_name	other_scsr+   desc	subparsernamer   r   r   
get_parser*   s<   
rF      c                 C   s6   t | \}}|| }|js|  d S || d S N)rF   
parse_argsr&   
print_helpmain)r=   parserr@   argsr   r   r   api_main^   s   
rN   c                   C   s   t   t  d S rH   )r   rN   r   r   r   r   cli_mainj   s   
rO   __main__)r0   r,   os.pathr   	importlibr   pypdfium2_cli._setupr   r   r   r7   r   r3   r5   rF   r=   rN   rO   r   r   r   r   r   <module>   s6   4
