diff --git a/my/body/weight.py b/my/body/weight.py index 9a2ff00..6867070 100644 --- a/my/body/weight.py +++ b/my/body/weight.py @@ -8,7 +8,7 @@ from typing import NamedTuple, Iterator from ..core import LazyLogger from ..core.error import Res, set_error_datetime, extract_error_datetime -from ..notes import orgmode +from .. import orgmode from my.config import weight as config diff --git a/my/notes/orgmode.py b/my/orgmode.py similarity index 85% rename from my/notes/orgmode.py rename to my/orgmode.py index dd33fe7..37a3863 100644 --- a/my/notes/orgmode.py +++ b/my/orgmode.py @@ -6,9 +6,9 @@ from glob import glob from typing import List, Sequence, Iterator from pathlib import Path -from ..common import PathIsh +from .core import PathIsh -from my.config import orgmode as config +from my.config import orgmode as user_config from porg import Org @@ -25,9 +25,9 @@ def _org_files_in(ppp: Path, archived: bool=False) -> Iterator[Path]: yield from ppp.rglob('*.org_archive') -def org_files(roots=config.roots, archived: bool=False) -> Iterator[Path]: +def org_files(roots=user_config.roots, archived: bool=False) -> Iterator[Path]: # TODO rename to 'paths'? use get_files? - for p in config.roots: + for p in roots: yield from _org_files_in(Path(p), archived=archived) @@ -56,4 +56,4 @@ class PorgAll: def query(): - return PorgAll(roots=config.roots) + return PorgAll(roots=user_config.roots) diff --git a/tests/orgmode.py b/tests/orgmode.py index 2675d0d..6467f0d 100644 --- a/tests/orgmode.py +++ b/tests/orgmode.py @@ -1,7 +1,7 @@ -import my.notes.orgmode as orgmode +from my import orgmode -def test(): +def test() -> None: # meh results = list(orgmode.query().query_all(lambda x: x.with_tag('python'))) assert len(results) > 5