use my.config instead of mycfg; minor cleanups and docstrings

This commit is contained in:
Dima Gerasimov 2020-04-12 00:18:48 +01:00
parent f31ff71e6f
commit 9fe5c8e670
37 changed files with 142 additions and 110 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
Module for Reddit data: saved items/comments/upvotes etc
"""
from . import init
from pathlib import Path
from typing import List, Sequence, Mapping, Iterator
@ -9,19 +9,19 @@ from typing import List, Sequence, Mapping, Iterator
from .kython.kompress import CPath
from .common import mcachew, get_files, LazyLogger, make_dict
from mycfg import paths
import mycfg.repos.rexport.dal as rexport
from my.config import reddit as config
import my.config.repos.rexport.dal as rexport
def get_sources() -> Sequence[Path]:
# TODO use zstd?
# TODO maybe add assert to get_files? (and allow to suppress it)
files = get_files(paths.rexport.export_dir, glob='*.json.xz')
files = get_files(config.export_dir, glob='*.json.xz')
res = list(map(CPath, files)); assert len(res) > 0
return tuple(res)
logger = LazyLogger('my.reddit', level='debug')
logger = LazyLogger(__package__, level='debug')
Sid = rexport.Sid