Skip to content

Commit

Permalink
Improve some docs wording
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Mar 6, 2021
1 parent 2211448 commit e347318
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/writing-exts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ an `InvalidConfigError`.

Callables can resolve password fields by passing them to `resolve_password()`
or by using pydantic and the `Password` type. Callables should resolve paths
relative to ``configpath`` by using `resolve_path()` or by using pydantic and
the `Path`, `FilePath`, and/or `DirectoryPath` types.
relative to the directory containing ``configpath`` by using `resolve_path()`
or by using pydantic and the `Path`, `FilePath`, and/or `DirectoryPath` types.

The last step of writing a sending method is to package it in a Python project
and declare the callable as an entry point in the ``outgoing.senders`` entry
Expand Down
5 changes: 3 additions & 2 deletions src/outgoing/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class Path(pathlib.Path):
Converts its input to `pathlib.Path` instances, including expanding
tildes. If there is a field named ``configpath`` declared before the
`Path` field and its value is non-`None`, then the value of the `Path`
field will be resolved relative to the ``configpath`` field; otherwise,
it will be resolved relative to the current directory.
field will be resolved relative to the parent directory of the
``configpath`` field; otherwise, it will be resolved relative to the
current directory.
"""

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions src/outgoing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def resolve_path(path: AnyPath, basepath: Optional[AnyPath] = None) -> Path:
"""
Convert a path to a `pathlib.Path` instance and resolve it using the same
rules for as paths in ``outgoing`` configuration files: expand tildes by
calling `Path.expanduser()`, prepend ``basepath`` (usually the value of
``configpath``) to the path if given, and then resolve the resulting path
to make it absolute.
calling `Path.expanduser()`, prepend the parent directory of ``basepath``
(usually the value of ``configpath``) to the path if given, and then
resolve the resulting path to make it absolute.
:param path path: the path to resolve
:param path basepath: an optional path to resolve ``path`` relative to
Expand Down

0 comments on commit e347318

Please sign in to comment.