
    m`c                     n    d dl mZmZ d dlZd dlZddlmZmZ d Zd Zd	dZ	e
dk    r e	             dS dS )
    )print_functionabsolute_importN   )slugifyDEFAULT_SEPARATORc                    t          j        d                              d          }|                    ddd           |                    dd	d
                               ddddd                               ddddd                               ddddd                               dt          dd                               dd	dd                               d d	dd!                               d"t
          t          d#t          z                                  d$d%d&                               d'd()                               d*dd+dd,                               d-d%d.                               | d/d                    }|j        r|j	        r
                    d0           |j        rfd1fd2|j        D             |_        |j        r d3                    |j                  |_        n*|j	        r#t          j	                                        |_        |j        sd4|_        |S )5NzSlug string)descriptionInputinput_string*zText to slugify)nargshelpz--stdin
store_truezTake the text from STDIN)actionr   z--no-entitiesstore_falseentitiesTz'Do not convert HTML entities to unicode)r   destdefaultr   z--no-decimaldecimalz&Do not convert HTML decimal to unicodez--no-hexadecimalhexadecimalz*Do not convert HTML hexadecimal to unicodez--max-lengthr   z$Output string length, 0 for no limit)typer   r   z--word-boundaryFzJTruncate to complete word even if length ends up shorter than --max_length)r   r   r   z--save-orderzEWhen set and --max_length > 0 return whole words in the initial orderz--separatorz$Separator between words. By default z--stopwords+zWords to discountz--regex-patternz+Python regex pattern for allowed characters)r   z--no-lowercase	lowercasezActivate case sensitivityz--replacementsz9Additional replacement rules e.g. "|->or", "%%->percent".r   z.Input strings and --stdin cannot work togetherc                     d}|| vr)                     d                    |                     |                     |d          S )Nz->z7Replacements must be of the form: ORIGINAL{SEP}REPLACED)SEPr   )errorformatsplit)replr   parsers     0lib/python3.11/site-packages/slugify/__main__.pysplit_checkzparse_args.<locals>.split_check.   sJ    C$V]]be]ffggg::c1%%%    c                 &    g | ]} |          S  r%   ).0r   r"   s     r!   
<listcomp>zparse_args.<locals>.<listcomp>3   s#    MMM4[[..MMMr#     )argparseArgumentParseradd_argument_groupadd_argumentintstrr   
parse_argsr   stdinr   replacementsjoinsysread)argvinput_groupargsr    r"   s      @@r!   r0   r0      s,   $???F+++@@K^3"3  5 5 5Y|"<  > > > JX\F  H H H
}9VZE  G G G
*=}^bI  K K K
S!C  E E E
),i  k k k
|Ud  f f f
C9JCFWW  Y Y Y
S0  2 2 2
)J  L L L
([Z^8  : : :
(\  ^ ^ ^ T!""X&&D GTZ GEFFF N	& 	& 	& 	& 	&
 NMMM4;LMMM -HHT%677	 -INN,, Kr#   c                     t          | j        | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j                  S )N)textr   r   r   
max_lengthword_boundary
save_order	separator	stopwordsr   r2   )dictr   r   r   r   r;   r<   r=   r>   r?   r   r2   )r8   s    r!   slugify_paramsrA   @   sT    $?(?...&   r#   c                     | t           j        } t          |           }t          |          }	 t	          t          di |           dS # t          $ r t          j        d           Y dS w xY w)z Run this program Nr%   )r4   r6   r0   rA   printr   KeyboardInterruptexit)r6   r8   paramss      r!   mainrH   P   s}    |xdDD!!Fg        s   A	 	A+*A+__main__)N)
__future__r   r   r*   r4   r   r   r0   rA   rH   __name__r%   r#   r!   <module>rL      s    6 6 6 6 6 6 6 6  



 / / / / / / / /5 5 5p   	 	 	 	 zDFFFFF r#   