Skip to content

Commit

Permalink
feat: allow Path to be passed as parameter for path prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobu committed Jan 6, 2025
1 parent 94ff1eb commit e401e8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions questionary/prompts/path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from pathlib import Path
from typing import Any
from typing import Callable
from typing import Iterable
Expand Down Expand Up @@ -115,7 +116,7 @@ def get_completions(

def path(
message: str,
default: str = "",
default: Path | str = "",
qmark: str = DEFAULT_QUESTION_PREFIX,
validate: Any = None,
completer: Optional[Completer] = None,
Expand Down Expand Up @@ -238,6 +239,6 @@ def next_segment(event: KeyPressEvent):
key_bindings=bindings,
**kwargs,
)
p.default_buffer.reset(Document(default))
p.default_buffer.reset(Document(str(default)))

return Question(p.app)

0 comments on commit e401e8a

Please sign in to comment.