cleanup locations.takeout a bit

This commit is contained in:
Dima Gerasimov 2019-12-22 17:13:59 +00:00
parent 89efa11a28
commit 64cd390db5
4 changed files with 63 additions and 53 deletions

View file

@ -1,11 +1,12 @@
import sys
import logging
from location import get_logger, get_locations, iter_locations, get_groups
from .takeout import get_logger, get_locations, iter_locations, get_groups
from kython.klogging import setup_logzero
# TODO remove this?
def main():
logger = get_logger()
setup_logzero(logger, level=logging.DEBUG)
@ -14,8 +15,9 @@ def main():
if len(sys.argv) > 1:
cmd = sys.argv[1]
# TODO ok, update cache makes sense just to refresh in case of code changes...
# TODO don't even need it anymore? cachew handles this..
if cmd == "update_cache":
from location import update_cache, get_locations
from .takeout import update_cache, get_locations
update_cache()
else:
raise RuntimeError(f"Unknown command {cmd}")