o
    UTi0                     @   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)pagesz--max-depth   zFMaximum recursion depth to consider when parsing the table of contents)typedefaulthelp)r   r   add_argumentint)parser r   M/var/www/html/RAG/RAG_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   get_tocr   	get_countget_destlevel	get_title	get_indexget_viewpdfium_iViewmodeToStrgetr   n_digitsprint)
argspdftocbmcountdestoutindex	view_modeview_posr   r   r   main   s&   




r-   )
pypdfium2.internalinternalr   pypdfium2._cli._parsersr   r   r   r   r   r-   r   r   r   r   <module>   s   