o
    j/                     @   s8   d dl mZ d dlmZmZmZmZ dd Zdd Z	dS )    N)	add_inputadd_n_digits	get_input
round_listc                 C   s*   t | dd t|  | jdtddd d S )NF)Zpagesz--max-depth   zFMaximum recursion depth to consider when parsing the table of contents)typedefaulthelp)r   r   add_argumentint)parser r   R/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pypdfium2_cli/toc.pyattach   s   
r   c           
      C   s   t | }|j| jd}|D ]Q}| | }}d|j }|d|dkr'|dnd| f 7 }|rV| | }\}}	|d|d krF|d nd	t	j
|t|	| jf 7 }n|d
7 }t| qd S )N)	max_depthz    z[%s] %s -> r   +*z%s  # %s %s   ?_)r   Zget_tocr   Z	get_countZget_destlevelZ	get_titleZ	get_indexZget_viewpdfium_iZViewmodeToStrgetr   Zn_digitsprint)
argsZpdfZtocZbmcountdestoutindexZ	view_modeZview_posr   r   r   main   s&   




r   )
Zpypdfium2.internalZinternalr   Zpypdfium2_cli._parsersr   r   r   r   r   r   r   r   r   r   <module>   s   