From 93e475795dabd1ff366c8f1e5993cf566eed5252 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Sat, 30 Dec 2023 16:52:14 -0800 Subject: [PATCH] google takeout: support multiple locales uses the known locales in google_takeout_parser to determine the expected paths for each locale, and performs a partial match on the paths to detect and use match_structure --- my/google/takeout/parser.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/my/google/takeout/parser.py b/my/google/takeout/parser.py index 96acfff..2322ef0 100644 --- a/my/google/takeout/parser.py +++ b/my/google/takeout/parser.py @@ -64,13 +64,19 @@ def inputs() -> Sequence[Path]: return get_files(config.takeout_path) -EXPECTED = ( - "My Activity", - "Chrome", - "Location History", - "Youtube", - "YouTube and YouTube Music", -) +try: + from google_takeout_parser.locales.main import get_paths_for_functions + + EXPECTED = tuple(get_paths_for_functions()) + +except ImportError: + EXPECTED = ( + "My Activity", + "Chrome", + "Location History", + "Youtube", + "YouTube and YouTube Music", + ) google_takeout_version = str(getattr(google_takeout_parser, '__version__', 'unknown'))