-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env python3 | ||
from pathlib import Path | ||
from typing import Any, Iterator | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from pathlib import Path | ||
from typing import Any, Iterator | ||
|
||
from bleanser.core.modules.extract import ExtractObjectsNormaliser | ||
|
||
from my.core.cfg import tmp_config | ||
import my.kobo | ||
|
||
|
||
class Normaliser(ExtractObjectsNormaliser): | ||
def extract_objects(self, path: Path) -> Iterator[Any]: | ||
class config: | ||
class kobo: | ||
export_path = path | ||
|
||
with tmp_config(modules=my.kobo.__name__, config=config): | ||
assert len(my.kobo.DATABASES) == 1 | ||
yield from [] | ||
|
||
yield from my.kobo._iter_highlights() | ||
# iter_highlights | ||
# iter_events | ||
# | ||
## sanity check to make sure tmp_config worked as expected | ||
# for most modules should be able to use module.inputs() directly though | ||
# dal = my.hypothesis._dal() | ||
# assert len(dal.sources) == 1 | ||
## | ||
# yield from my.hypothesis.highlights() | ||
|
||
|
||
if __name__ == '__main__': | ||
Normaliser.main() |