§ |<ˆjÒãóJ—UdZddlZddlZddlZddlmZddlmZddlmZddlmZGd„d¦«Z ej   d ¦«rE ddl Z n#e$rejd ¦«YnwxYwe ¦«Zee ed <d ejd dfd„ZdSd ejd dfd„ZdZdS)a»Allow bash-completion for argparse with argcomplete if installed. Needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail to find the magic string, so _ARGCOMPLETE env. var is never set, and this does not need special code). Function try_argcomplete(parser) should be called directly before the call to ArgumentParser.parse_args(). The filescompleter is what you normally would use on the positional arguments specification, in order to get "dirname/" after "dirn" instead of the default "dirname ": optparser.add_argument(Config._file_or_dir, nargs='*').completer=filescompleter Other, application specific, completers should go in the file doing the add_argument calls as they need to be specified as .completer attributes as well. (If argcomplete is not installed, the function the attribute points to will not be used). SPEEDUP ======= The generic argcomplete script for bash-completion (/etc/bash_completion.d/python-argcomplete.sh) uses a python program to determine startup script generated by pip. You can speed up completion somewhat by changing this script to include # PYTHON_ARGCOMPLETE_OK so the python-argcomplete-check-easy-install-script does not need to be called to find the entry point of the code and see if that is marked with PYTHON_ARGCOMPLETE_OK. INSTALL/DEBUGGING ================= To include this support in another application that has setup.py generated scripts: - Add the line: # PYTHON_ARGCOMPLETE_OK near the top of the main python entry point. - Include in the file calling parse_args(): from _argcomplete import try_argcomplete, filescompleter Call try_argcomplete just before parse_args(), and optionally add filescompleter to the positional arguments' add_argument(). If things do not work right away: - Switch on argcomplete debugging with (also helpful when doing custom completers): export _ARC_DEBUG=1 - Run: python-argcomplete-check-easy-install-script $(which appname) echo $? will echo 0 if the magic line has been found, 1 if not. - Sometimes it helps to find early on errors using: _ARGCOMPLETE=1 _ARC_DEBUG=1 appname which should throw a KeyError: 'COMPLINE' (which is properly set by the global argcomplete script). éN)Úglob)ÚAny)ÚList)ÚOptionalcóD—eZdZdZd deddfd„Zdededeefd „Z dS) ÚFastFilesCompleterzFast file completer class.TÚ directoriesÚreturnNcó—||_dS©N)r )Úselfr s úf/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/_pytest/_argcomplete.pyÚ__init__zFastFilesCompleter.__init__Ls€Ø&ˆÔÐÐóÚprefixÚkwargsc ó0—tj|dd…vr:ttj |¦«tjz¦«}nd}g}g}d|vrFd|vrB|r|dtjkr%| t |dz¦«¦«|dz }| t |¦«¦«t|¦«D]C}tj |¦«r|dz }|  ||d…¦«ŒD|S)NérÚ*ú?éÿÿÿÿz.*ú/) ÚosÚsepÚlenÚpathÚdirnameÚextendrÚsortedÚisdirÚappend)r rrÚ prefix_dirÚ completionÚglobbedÚxs rÚ__call__zFastFilesCompleter.__call__Os€å Œ6�V˜A˜B˜B”ZÐ Ð Ý�RœWŸ_š_¨VÑ4Ô4µr´vÑ=Ñ>Ô>ˆJˆJàˆJ؈ ØˆØ �fÐ Ð  ¨FÐ!2Ð!2àð 4˜V BœZ­2¬6Ò1Ð1Ø—’�t F¨T¡MÑ2Ô2Ñ3Ô3Ð3Ø �c‰MˆFØ�Š•t˜F‘|”|Ñ$Ô$Ð$ݘ‘”ð .ð .ˆAÝŒw�}Š}˜QÑÔð Ø�S‘�à × Ò ˜a      œnÑ -Ô -Ð -Ð -ØÐr)T) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚboolrÚstrrrr&©rrrrIsn€€€€€Ø$Ð$ð'ð' Dð'°Dð'ð'ð'ð'ð˜sð¨cð°d¸3´iððððððrrÚ _ARGCOMPLETErÚfilescompleterÚparserr có2—tj|d¬¦«dS)NF)Úalways_complete_options)Ú argcompleteÚ autocomplete©r0s rÚtry_argcompleter6ls€ÝÔ  ÀÐGÑGÔGÐGÐGÐGrcó—dSr r-r5s rr6r6qs€Ø ˆr)r*ÚargparserÚsysrÚtypingrrrrÚenvironÚgetÚargcomplete.completersr3Ú ImportErrorÚexitr/Ú__annotations__ÚArgumentParserr6r-rrúrBs‚ðð>ð>ð>ð~€€€Ø € € € Ø € € € ØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐðððððñôðð8„:‡>‚>�.Ñ!Ô!ððØ%Ð%Ð%Ð%Ð%øØ ðððØˆŒ�‰ Œ ˆ ˆ ˆ ðøøøà3EÐ3EÑ3GÔ3G€N�HÐ/Ô0ÐGÐGÑGðH Ô 7ðH¸DðHðHðHðHðHðHð   Ô 7ð ¸Dð ð ð ð ð€N€N€NsÁAÁA-Á,A-