
    PiC                    &    d Z ddlmZ ddZdd	Zd
S )z2Bash quoting utilities for command reconstruction.    )annotationssstrreturnc                    | sdS d}| D ]}|                                 s|dv sd} n|r| S d|                     dd          z   dz   S )zQuote a string for safe use in bash.

    Uses single quotes (safest), with escape handling for embedded single quotes.
    Returns '' for empty strings. Returns unquoted if no special chars.
    z''Tz-_./=@:F'z'"'"')isalnumreplace)r   safecs      0/root/projects/gits/Dippy/src/dippy/core/bash.py
bash_quoter      ss      tD  		 	qI~~DE 3	***S00    tokens	list[str]c                @    d                     d | D                       S )z;Join tokens into a bash command string with proper quoting. c              3  4   K   | ]}t          |          V  d S )N)r   ).0ts     r   	<genexpr>zbash_join.<locals>.<genexpr>   s(      22aJqMM222222r   )join)r   s    r   	bash_joinr      s#    88226222222r   N)r   r   r   r   )r   r   r   r   )__doc__
__future__r   r   r    r   r   <module>r      sO    8 8 " " " " " "1 1 1 1(3 3 3 3 3 3r   