Skip to content

Commit

Permalink
chore: replace deprecated function usage
Browse files Browse the repository at this point in the history
  • Loading branch information
purarue committed Nov 16, 2024
1 parent 95863d1 commit dd83aeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions google_takeout_parser/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def parse(
# note: actually no exceptions since since they're dropped
if cache:
if filter_:
logger.warn(
logger.warning(
"As it would otherwise re-compute every time, filtering happens after loading from cache"
)
res = list(tp.parse(cache=True))
Expand Down Expand Up @@ -173,7 +173,7 @@ def merge(
filter_type = tuple(FILTER_OPTIONS[ff] for ff in filter_)
if cache:
if filter_:
logger.warn(
logger.warning(
"As it would otherwise re-compute every time, filtering happens after loading from cache"
)
res = list(cached_merge_takeouts(list(takeout_dir), locale_name=locale))
Expand Down
4 changes: 3 additions & 1 deletion google_takeout_parser/parse_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def _parse_chrome_history(p: Path) -> Iterator[Res[ChromeHistory]]:
yield RuntimeError(f"Chrome/BrowserHistory: no 'Browser History' key in '{p}'")
for item in json_data.get("Browser History", []):
try:
time_naive = datetime.utcfromtimestamp(item["time_usec"] / 10**6)
time_naive = datetime.fromtimestamp(
item["time_usec"] / 10**6, tz=timezone.utc
)
yield ChromeHistory(
title=item["title"],
# dont convert to https here, this is just the users history
Expand Down

0 comments on commit dd83aeb

Please sign in to comment.