o
    f                     @   s,   d dl mZ d dlmZ dd Zdd ZdS )    Nparse_numtextc                 C   sJ   | j dddd | j ddg dd | j ddg d	d | j d
dddd d S )Ninputs+zSequence of PDF files.)nargshelpz--pagesziSequence of page texts, definig the pages to include from each PDF. Use '_' as placeholder for all pages.)r   defaultr   z--passwordsz\Passwords to unlock encrypted PDFs. Any placeholder may be used for non-encrypted documents.z--outputz-oTz#Target path for the output document)requiredr   )add_argument)parser r   O/home/ubuntu/webapp/venv/lib/python3.10/site-packages/pypdfium2/_cli/arrange.pyattach	   s,   
r   c                 C   s   dd | j D | _ tt| jt| j  D ]}| j d  qtt| jt| j D ]}| jd  q*tj }d}t	| j| j | jD ]\}}}tj||d}|j
||d |t|7 }qC|| j d S )Nc                 S   s    g | ]}|d kr
dnt |qS )_Nr   ).0pr   r   r   
<listcomp>$   s     zmain.<locals>.<listcomp>r   )password)pages)r   rangelenr   append	passwordspdfiumPdfDocumentnewzipimport_pagessaveoutput)argsr   dest_pdfindexin_pathr   r   src_pdfr   r   r   main"   s   
r%   )pypdfium2._helpers_helpersr   pypdfium2._cli._parsersr   r   r%   r   r   r   r   <module>   s   