quickie.completion.python.PytestCompleter
- class quickie.completion.python.PytestCompleter(wd: str | Path | None = None)
For auto-completion of paths, but also adds python module completion.
It auto-completes paths as usual, but if the path points to a python file, it will suggest to add ::, and classes/functions after that.
For example a suggestion can look like path/to/file.py::MyClass::my_function.
- __init__(wd: str | Path | None = None)
Initialize the completer.
- Parameters:
wd – The working directory to resolve paths relative to. Follows the same resolution rules as task working directories:
Noneusesapp.context.wd,"."uses the tasks module parent directory,"./path"is resolved relative to the tasks module parent directory, other relative paths are joined withapp.context.wd, and absolute paths are used as-is.
Methods
__init__([wd])Initialize the completer.
complete(prefix, **kwargs)Complete the prefix.
get_pre_filtered_paths(target_dir)Get path names in the target directory.
get_wd()Get the resolved working directory.