google_takeout: add semantic location history (#278)

* google_takeout: add semantic location history
This commit is contained in:
seanbreckenridge 2023-03-04 10:36:10 -08:00 committed by GitHub
parent a4c713664e
commit 9d231a8ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 0 deletions

View file

@ -16,6 +16,7 @@ logger = LazyLogger(__name__, level="warning")
def locations() -> Iterator[Location]:
# can add/comment out sources here to disable them, or use core.disabled_modules
yield from _takeout_locations()
yield from _takeout_semantic_locations()
yield from _gpslogger_locations()
yield from _ip_locations()
@ -26,6 +27,17 @@ def _takeout_locations() -> Iterator[Location]:
yield from google_takeout.locations()
@import_source(module_name="my.location.google_takeout_semantic")
def _takeout_semantic_locations() -> Iterator[Location]:
from . import google_takeout_semantic
for event in google_takeout_semantic.locations():
if isinstance(event, Exception):
logger.error(f"google_takeout_semantic: {event}")
continue
yield event
@import_source(module_name="my.location.gpslogger")
def _gpslogger_locations() -> Iterator[Location]:
from . import gpslogger