def config() -> commits_cfg: res = make_config(commits_cfg) if res.emails is None and res.names is None: # todo error policy? throw/warn/ignore high("Set either 'emails' or 'names', otherwise you'll get no commits") return res
from my.core.structure import match_structure from google_takeout_parser.path_dispatch import TakeoutParser from google_takeout_parser.merge import GoogleEventSet, CacheResults # see https://github.com/seanbreckenridge/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import google as user_config @dataclass class google(user_config): # directory to unzipped takeout data takeout_path: Paths config = make_config(google) logger = LazyLogger(__name__, level="warning") # patch TAKEOUT_LOGS to match HPI_LOGS if "HPI_LOGS" in os.environ: from google_takeout_parser.log import setup as setup_takeout_logger from my.core.logging import mklevel setup_takeout_logger(mklevel(os.environ["HPI_LOGS"])) DISABLE_TAKEOUT_CACHE = "DISABLE_TAKEOUT_CACHE" in os.environ