Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Jul 15, 2024
1 parent 42a1831 commit 03290d7
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/mandr/infomander.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,26 @@ def _get_storage_path() -> Path:
class InfoMander:
"""Represents a dictionary, on disk, with a path-like structure."""

def __init__(self, path):
def __init__(self, path: Path | str) -> None:
"""
Initialize an `InfoMander`.
Parameters
----------
path : path-like
The path of the `InfoMander` on the filesystem.
If given a relative path (i.e. does not start with '/'), then the resulting
path will be relative to the root storage path, which by default is
`/.datamander`.
Examples
--------
>>> InfoMander("hello")
InfoMander(.datamander/hello)
>>> InfoMander("/hello")
InfoMander(/hello)
"""
# Set local disk paths
self.path = path
self.project_path = _get_storage_path() / path
Expand Down

0 comments on commit 03290d7

Please sign in to comment.