}BFj$dZddlZddlmZddlmZmZmZddlmZm Z ddl m Z ddl m Z ddl mZdd lmZddlmZddlZddlZddlZeZd ed efd Zd ed eded efdZd ed ed efdZdZGddeZGdde Z dS)zfprompt-toolkit utilities Everything in this module is a private API, not to be used outside IPython. N)wcwidth)provisionalcompletercursor_to_position_deduplicate_completions) Completer Completion)Lexer) PygmentsLexer) patch_stdout) get_ipythonstringreturnc|dd}|dd}t||kr|S|d}|tj}|ddkr|t|dkr@d |d |d d d |d dd |dSt|dkr`dtjzdztjzdz|d |d d d |d dd |dS|S)a If a string is long enough, and has at least 3 dots, replace the middle part with ellipses. If a string naming a file is long enough, and has at least 3 slashes, replace the middle part with ellipses. If three consecutive dots, or two consecutive dots are encountered these are replaced by the equivalents HORIZONTAL ELLIPSIS or TWO DOT LEADER unicode equivalents z...…z..u‥.u {}.{}…{}.{}rNz{}u{}…{})replacelensplitosseppopformat)r min_elide object_parts file_partss FC:\PYTHON\_runtimes\venv\Lib\site-packages\IPython/terminal/ptutils.py _elide_pointr"sU^^E"; <     Mtypedrct||kr|St|dz }|dkr|S||r7t|t|kr|ddd||dS|S)zT Elide the middle of a long string if the beginning has already been typed. rNr)r startswith)r r$r cut_how_muchs r! _elide_typedr)Es  6{{Y u::a?????@  @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @s|D.C?*#B C? C0-CC+C# C+"C# #C+&C?+C00C?3 D?D DD DDDc #|Kt|dd}t||||}|D]}|js t jd|j}t |ddkrp||jzdkrb||jdz } t jd| |z} t |dddkrt| |j|z dz V|j} t|j||} |j dn |j j } |j d krQt| |j|z t| d z||j|j| |j |jz Vrs<;;;;;;;''''''//////444444//////*))))) vxx##s####L  S      $3$s$#$$$$````````F!,!,!,!,!,U!,!,!,!,!,r#