From 339127ace1f2f5cedaf9f2e364bb9754d1e1558c Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Sun, 14 Mar 2021 08:27:51 -0700 Subject: [PATCH] smscalls: add config block so that don't have to infer what to set in your hpi config based on usage in module --- my/smscalls.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/my/smscalls.py b/my/smscalls.py index 66c6255..4e02f3b 100644 --- a/my/smscalls.py +++ b/my/smscalls.py @@ -1,15 +1,26 @@ """ Phone calls and SMS messages +Exported using https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore&hl=en_US """ + +from .core import PathIsh, dataclass +from my.config import smscalls as user_config + +@dataclass +class smscalls(user_config): + # directory that SMSBackupRestore syncs XML files to + export_path: PathIsh + +from .core.cfg import make_config +config = make_config(smscalls) + from datetime import datetime, timezone from pathlib import Path from typing import NamedTuple, Iterator, Set, Tuple from lxml import etree # type: ignore -from .core.common import get_files - -from my.config import smscalls as config +from .core.common import get_files, Stats class Call(NamedTuple): @@ -91,7 +102,7 @@ def _parse_dt_ms(d: str) -> datetime: return datetime.fromtimestamp(int(d) / 1000, tz=timezone.utc) -def stats(): +def stats() -> Stats: from .core import stat return {