Files
ServerSync/lib/questionary/prompts/__pycache__/path.cpython-314.pyc

144 lines
12 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<EFBFBD>&<00> <00>b<00>^RIt^RIHt^RIHt^RIHt^RIHt^RIHt^RIHt^RIH t ^R IH
t
^R
IH t ^R I H t ^R IHt^R IHt^RIHt^RIHt^RIHt^RIHt^RIHt^RIHt^RIHt^RIH t ^RI!H"t"^RI#H$t$!RR] 4t%R]RRRRRR]PL3 RRllt'R#)<1E>N)<01>Any)<01>Callable)<01>Iterable)<01>List)<01>Optional)<01>Tuple)<01> CompleteEvent)<01>
Completion)<01> PathCompleter)<01> Completer)<01>Document)<01> KeyBindings<67><01> KeyPressEvent)<01>Keys)<01> SimpleLexer)<01> CompleteStyle)<01> PromptSession)<01>Style)<01>DEFAULT_QUESTION_PREFIX)<01>build_validator)<01>Question)<01>merge_styles_defaultc<00>^aa<01>]tRt^toRtRV3RlV3RllltV3RlV3RlltRtVtV;t #)<08>GreatUXPathCompleterz<72>Wraps :class:`prompt_toolkit.completion.PathCompleter`.
Makes sure completions for directories end with a path separator. Also make sure
the right path separator is used. Checks if `get_paths` returns list of existing
directories.
c <00><><<01>V^8<>dQhRS[RS[S[.S[S[,3,,RS[S[S[.S[3,,RS[RS[RR/#)<08><00>only_directories<65> get_paths<68> file_filter<65> min_input_len<65>
expanduser<EFBFBD>returnN)<06>boolrrr<00>str<74>int)<02>format<61> __classdict__s"<22><>?/tmp/pip-target-wqrk2shd/lib/python/questionary/prompts/path.py<70> __annotate__<5F>!GreatUXPathCompleter.__annotate__$si<00><><00>.
<EFBFBD>.
<EFBFBD><1E>.
<EFBFBD><1C>H<EFBFBD>R<EFBFBD><14>c<EFBFBD><19>]<5D>3<>4<>.
<EFBFBD><1E>h<EFBFBD><03>u<EFBFBD>d<EFBFBD>{<7B>3<>4<> .
<EFBFBD>
<1B> .
<EFBFBD> <19> .
<EFBFBD>
<0E>.
<EFBFBD>c <0C><><<01>T;'gRpV!4F7p\PPV4'dK*\RV R24h \SV`VVVVVR7R#)a<>Adds validation of 'get_paths' to :class:`prompt_toolkit.completion.PathCompleter`.
Args:
only_directories (bool): If True, only directories will be
returned, but no files. Defaults to False.
get_paths (Callable[[], List[str]], optional): Callable which
returns a list of directories to look into when the user enters a
relative path. If None, set to (lambda: ["."]). Defaults to None.
file_filter (Callable[[str], bool], optional): Callable which
takes a filename and returns whether this file should show up in the
completion. ``None`` when no filtering has to be done. Defaults to None.
min_input_len (int): Don't do autocompletion when the input string
is shorter. Defaults to 0.
expanduser (bool): If True, tilde (~) is expanded. Defaults to
False.
Raises:
ValueError: If any of the by `get_paths` returned directories does not
exist.
c<00><00>R.#)<01>.<2E>r0r,r)<00><lambda><3E>/GreatUXPathCompleter.__init__.<locals>.<lambda>As<00><00>3<EFBFBD>%r,zS
Completer for file paths 'get_paths' must return only existing directories, but 'z' does not exist.)rrr r!r"N)<06>os<6F>path<74>isdir<69>
ValueError<EFBFBD>super<65>__init__)<08>selfrrr r!r"<00> current_path<74> __class__s&&&&&& <20>r)r8<00>GreatUXPathCompleter.__init__$ss<00><><00>:<1E>0<>0<>-<2D> <09>%<25>K<EFBFBD>L<EFBFBD><15>7<EFBFBD>7<EFBFBD>=<3D>=<3D><1C>.<2E>.<2E><1E><1D>)<29>N<EFBFBD>*;<3B>=<3D><16><12>(<28> <0E><07><18>-<2D><1F>#<23>'<27>!<21> <19>
r,c<00><<<01>V^8<>dQhRS[RS[RS[S[,/#)r<00>document<6E>complete_eventr#)r r rr
)r'r(s"<22>r)r*r+Ts*<00><><00><1D><1D> <20><1D>2?<3F><1D> <11>*<2A> <1D>r,c# <0C><><"<00>\\V` W4pVF<>pVP^,pV^,R,R8XduV^,RR\P
P ,pV^,V3VP^&V;P\P
P , unVx<00>K<> R#5i)z<>Get completions.
Wraps :class:`prompt_toolkit.completion.PathCompleter`. Makes sure completions
for directories end with a path separator. Also make sure the right path
separator is used.
<EFBFBD>/N<><4E><EFBFBD><EFBFBD><EFBFBD>)r7r<00>get_completions<6E>displayr3r4<00>sep<65>text)r9r>r?<00> completions<6E>
completion<EFBFBD>styled_display<61> display_textr;s&&& <20>r)rC<00>$GreatUXPathCompleter.get_completionsTs<><00><><00><00><1C>0<>$<24>G<> <14>
<EFBFBD> <0B>&<26>J<EFBFBD>(<28>/<2F>/<2F><01>2<>N<EFBFBD><1E>a<EFBFBD> <20><12>$<24><03>+<2B>-<2D>a<EFBFBD>0<><13>"<22>5<><02><07><07> <0B> <0B>C<> <0C>)7<><01>):<3A>L<EFBFBD>(I<>
<EFBFBD>"<22>"<22>1<EFBFBD>%<25>
<1B><0F><0F>2<EFBFBD>7<EFBFBD>7<EFBFBD>;<3B>;<3B>.<2E><0F><1C> <1C>!&<26>s<00>B?Cr0)FNNrF)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__r8rC<00>__static_attributes__<5F>__classdictcell__<5F> __classcell__)r;r(s@@r)rrs$<00><><00><00><08>.
<EFBFBD>.
<EFBFBD>`<1D><1D>r,r<00>Fc<00>T<00>V^8<>dQhR\R\R\R\R\\,R\\,R\
R\\ .\\,3,,R \\ \.\
3,,R
\R \R \/ #) r<00>message<67>default<6C>qmark<72>validate<74> completer<65>stylerrr <00>complete_style<6C>kwargsr#)
r%rrr rr$rrrr)r's"r)r*r*ts<><00><00><1B><1B> <10><1B> <10><1B> <0F><1B><12> <1B>
<18> <09>"<22> <1B> <14>E<EFBFBD>?<3F> <1B><1B><1B><18><08><12>T<EFBFBD>#<23>Y<EFBFBD><1D>/<2F>0<><1B><1A>(<28>C<EFBFBD>5<EFBFBD>$<24>;<3B>/<2F>0<><1B>"<22><1B><12><1B><0E>r,c
 <04><>aa<02>\V.4p RVV3Rllp \V4p T;'g\VVVRR7p\4pVP \
P RR7RRl4pVP \PPRR7RR l4p\V 3R
\R 4R V R VRV RV RV/V
BpVPP\V44\VP 4#)a
A text input for a file or directory path with autocompletion enabled.
Example:
>>> import questionary
>>> questionary.path(
>>> "What's the path to the projects version file?"
>>> ).ask()
? What's the path to the projects version file? ./pyproject.toml
'./pyproject.toml'
.. image:: ../images/path.gif
This is just a really basic example, the prompt can be customized using the
parameters.
Args:
message: Question text.
default: Default return value (single value).
qmark: Question prefix displayed in front of the question.
By default this is a ``?``.
complete_style: How autocomplete menu would be shown, it could be ``COLUMN``
``MULTI_COLUMN`` or ``READLINE_LIKE`` from
:class:`prompt_toolkit.shortcuts.CompleteStyle`.
validate: Require the entered value to pass a validation. The
value can not be submitted until the validator accepts
it (e.g. to check minimum password length).
This can either be a function accepting the input and
returning a boolean, or an class reference to a
subclass of the prompt toolkit Validator class.
completer: A custom completer to use in the prompt. For more information,
see `this <https://python-prompt-toolkit.readthedocs.io/en/master/pages/asking_for_input.html#a-custom-completer>`_.
style: A custom color and style for the question parts. You can
configure colors as well as font types for different elements.
only_directories: Only show directories in auto completion. This option
does not do anything if a custom ``completer`` is
passed.
get_paths: Set a callable to generate paths to traverse for suggestions. This option
does not do anything if a custom ``completer`` is
passed.
file_filter: Optional callable to filter suggested paths. Only paths
where the passed callable evaluates to ``True`` will show up in
the suggested paths. This does not validate the typed path, e.g.
it is still possible for the user to enter a path manually, even
though this filter evaluates to ``False``. If in addition to
filtering suggestions you also want to validate the result, use
``validate`` in combination with the ``file_filter``.
Returns:
:class:`Question`: Question instance, ready to be prompted (using ``.ask()``).
c<00>\<00>V^8<>dQhR\\\\3,,/#)rr#)rrr%)r's"r)r*<00>path.<locals>.__annotate__<5F>s#<00><00>T<01>T<01>t<EFBFBD>E<EFBFBD>#<23>s<EFBFBD>(<28>O<EFBFBD>4<>Tr,c<00>2<<02>RS3RRPS43.#)z class:qmarkzclass:questionz {} )r')rVrXs<00><>r)<00>get_prompt_tokens<6E>path.<locals>.get_prompt_tokens<6E>s"<00><><00><1E><05>&<26>)9<>6<EFBFBD>=<3D>=<3D><17>;Q<>(R<>S<>Sr,T)rrr r")<01>eagerc<00>$<00>V^8<>dQhR\/#<00>r<00>eventr)r's"r)r*r`<00>s<00><00>
9<>
9<>-<2D>
9r,c<00><><00>VPPeRVPnR#VPPPRR7'd<>VPPPP
pVP \PP4'dVRRpVPPVR7VPPP4R#R#)NT)<01>
set_cursor)<01>resultrB) <0C>current_buffer<65>complete_state<74>apprYr>rF<00>endswithr3r4rE<00>exit<69>append_to_history)rg<00> result_paths& r)<00>
set_answer<EFBFBD>path.<locals>.set_answer<65>s<><00><00> <10> <1F> <1F> .<2E> .<2E> :<3A>26<32>E<EFBFBD> <20> <20> /<2F> <12>Y<EFBFBD>Y<EFBFBD> %<25> %<25> .<2E> .<2E>$<24> .<2E> ?<3F> ?<3F><1F>)<29>)<29>2<>2<>;<3B>;<3B>@<40>@<40>K<EFBFBD><1A>#<23>#<23>B<EFBFBD>G<EFBFBD>G<EFBFBD>K<EFBFBD>K<EFBFBD>0<>0<>)<29>#<23>2<EFBFBD>.<2E> <0B> <11>I<EFBFBD>I<EFBFBD>N<EFBFBD>N<EFBFBD>+<2B>N<EFBFBD> .<2E> <11>I<EFBFBD>I<EFBFBD> $<24> $<24> 6<> 6<> 8<>@r,c<00>$<00>V^8<>dQhR\/#rfr)r's"r)r*r`<00>s<00><00>
/<2F>
/<2F>M<EFBFBD>
/r,c<00>d<00>VPPpVP'dRVnVPPpVP \ PP4'g*VP\ PP4VPRR7R#)NF)<01> select_first) rmrkrlr>rFrnr3r4rE<00> insert_text<78>start_completion)rg<00>br:s& r)<00> next_segment<6E>path.<locals>.next_segment<6E>sp<00><00> <11>I<EFBFBD>I<EFBFBD> $<24> $<24><01> <0C> <1B> <1B> <1B>#<23>A<EFBFBD> <1C><18>z<EFBFBD>z<EFBFBD><EFBFBD><EFBFBD> <0C><1B>$<24>$<24>R<EFBFBD>W<EFBFBD>W<EFBFBD>[<5B>[<5B>1<>1<> <0A>M<EFBFBD>M<EFBFBD>"<22>'<27>'<27>+<2B>+<2B> &<26> <09><1A><1A><05><1A>.r,<00>lexerz class:answerr[rZ<00> validatorr\<00> key_bindings)rrrr<00>addr<00>ControlMr3r4rErr<00>default_buffer<65>resetr rrm)rVrWrXrYrZr[rrr r\r]<00> merged_stylerbr}<00>bindingsrrrz<00>psf&f&&&&&&&, r)r4r4ts#<00><><00>R(<28><15><07>0<>L<EFBFBD>T<01>T<01> <20><08>)<29>I<EFBFBD><19><06><06>1<><1B>)<29><1F><17> <06>I<EFBFBD><1B>}<7D>H<EFBFBD> <0A>\<5C>\<5C>$<24>-<2D>-<2D>t<EFBFBD>\<5C>,<2C>
9<>-<2D>
9<><0E>\<5C>\<5C>"<22>'<27>'<27>+<2B>+<2B>T<EFBFBD>\<5C>*<2A>
/<2F>+<2B>
/<2F>%<25><19> <06><19>.<2E>)<29> <06><1B> <06><1C> <06>
<1C> <06> &<26> <06><1E> <06> <11> <06>A<EFBFBD><06><14><14><1A><1A>8<EFBFBD>G<EFBFBD>,<2C>-<2D> <13>A<EFBFBD>E<EFBFBD>E<EFBFBD>?<3F>r,)(r3<00>typingrrrrrr<00>prompt_toolkit.completionr r
r <00>prompt_toolkit.completion.baser <00>prompt_toolkit.documentr <00>prompt_toolkit.key_bindingr<00>(prompt_toolkit.key_binding.key_processorr<00>prompt_toolkit.keysr<00>prompt_toolkit.lexersr<00>prompt_toolkit.shortcuts.promptrr<00>prompt_toolkit.stylesr<00>questionary.constantsr<00>questionary.prompts.commonr<00>questionary.questionr<00>questionary.stylesrr<00> MULTI_COLUMNr4r0r,r)<00><module>r<>s<><00><01> <09><16><1B><1B><17><1B><18>3<>0<>3<>4<>,<2C>2<>B<>$<24>-<2D>9<>9<>'<27>9<>6<>)<29>3<>U<1D>=<3D>U<1D>t<16>(<28><18>%)<29>!<21>"<22>37<33>37<33>$1<>$><3E>$><3E><1B>r,