Skip to content

Commit

Permalink
google takeout: support multiple locales
Browse files Browse the repository at this point in the history
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
  • Loading branch information
seanbreckenridge authored and karlicoss committed Dec 31, 2023
1 parent 1b187b2 commit 93e4757
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions my/google/takeout/parser.py
Expand Up @@ -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'))
Expand Down

0 comments on commit 93e4757

Please sign in to comment.