core: add warning when get_files returns no files, my.twitter.archive: make more defensive in case of no archives

This commit is contained in:
Dima Gerasimov 2020-05-24 12:51:23 +01:00
parent b7662378a2
commit b99b2f3cfa
3 changed files with 29 additions and 12 deletions

View file

@ -151,6 +151,12 @@ def get_files(pp: Paths, glob: str=DEFAULT_GLOB, sort: bool=True) -> Tuple[Path,
if sort:
paths = list(sorted(paths))
if len(paths) == 0:
# todo make it conditionally defensive based on some global settings
# todo stacktrace?
warnings.warn(f'No paths were matched against {paths}. This might result in missing data.')
return tuple(paths)