a
    õ£Be	  ã                   @  sN   d dl mZ d dlmZmZ d dlmZ d dlmZ dgZ	G dd„ deƒZ
dS )é    )Úannotations)ÚExecutableCompleterÚPathCompleter)Úcompile)ÚGrammarCompleterÚSystemCompleterc                      s&   e Zd ZdZddœ‡ fdd„Z‡  ZS )r   z(
    Completer for system commands.
    ÚNone)Úreturnc              
     s`   t ddd„ dd„ dœdd„ dd„ dœd�}tƒ  |tƒ td	d
d�td	d
d�td	d
d�dœ¡ d S )Na  
                # First we have an executable.
                (?P<executable>[^\s]+)

                # Ignore literals in between.
                (
                    \s+
                    ("[^"]*" | '[^']*' | [^'"]+ )
                )*

                \s+

                # Filename as parameters.
                (
                    (?P<filename>[^\s]+) |
                    "(?P<double_quoted_filename>[^\s]+)" |
                    '(?P<single_quoted_filename>[^\s]+)'
                )
            c                 S  s   |   dd¡S )Nú"ú\"©Úreplace©Ústring© r   úk/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/prompt_toolkit/contrib/completers/system.pyÚ<lambda>(   ó    z*SystemCompleter.__init__.<locals>.<lambda>c                 S  s   |   dd¡S )Nú'ú\'r   r   r   r   r   r   )   r   )Údouble_quoted_filenameÚsingle_quoted_filenamec                 S  s   |   dd¡S )Nr   r
   r   r   r   r   r   r   -   r   c                 S  s   |   dd¡S )Nr   r   r   r   r   r   r   r   /   r   )Zescape_funcsZunescape_funcsFT)Zonly_directoriesÚ
expanduser)Ú
executableÚfilenamer   r   )r   ÚsuperÚ__init__r   r   )ÚselfÚg©Ú	__class__r   r   r      s*    þüè!
ÿÿúþzSystemCompleter.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r   r      s   N)Ú
__future__r   Z$prompt_toolkit.completion.filesystemr   r   Z1prompt_toolkit.contrib.regular_languages.compilerr   Z3prompt_toolkit.contrib.regular_languages.completionr   Ú__all__r   r   r   r   r   Ú<module>   s   ÿ