core: add helper for computing stats; use it in modules
This commit is contained in:
parent
a94b64c273
commit
1cc4eb5d8d
10 changed files with 79 additions and 3 deletions
|
@ -66,6 +66,13 @@ def events() -> Iterable[Res[Event]]:
|
|||
yield e
|
||||
|
||||
|
||||
def stats():
|
||||
from ..core import stat
|
||||
return {
|
||||
**stat(events),
|
||||
}
|
||||
|
||||
|
||||
# TODO typing.TypedDict could be handy here..
|
||||
def _parse_common(d: Dict) -> Dict:
|
||||
url = d['url']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue