From 0269d2dcefeadefef89cf138f3cb6b948dadbc32 Mon Sep 17 00:00:00 2001 From: purarue <7804791+purarue@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:01:43 -0700 Subject: [PATCH] type updates from upstream --- my/activitywatch/active_window.py | 3 ++- my/apple/privacy_export.py | 5 +++-- my/bash.py | 5 +++-- my/blizzard/gdpr.py | 5 +++-- my/chess/export.py | 5 +++-- my/discord/data_export.py | 5 +++-- my/facebook/gdpr.py | 3 ++- my/grouvee/export.py | 3 ++- my/ip/discord.py | 2 +- my/ip/facebook.py | 2 +- my/ipython.py | 3 ++- my/league/export.py | 3 ++- my/linkedin/privacy_export.py | 3 ++- my/listenbrainz/export.py | 3 ++- my/location/apple.py | 7 ------- my/mail/imap.py | 3 ++- my/mail/mbox.py | 3 ++- my/mal/export.py | 3 ++- my/minecraft/advancements.py | 3 ++- my/mpv/history_daemon.py | 3 ++- my/offline/listens.py | 3 ++- my/piazza/scraper.py | 3 ++- my/project_euler.py | 3 ++- my/rss/newsboat/git_history.py | 3 ++- my/runelite/screenshots.py | 3 ++- my/scramble/history.py | 3 ++- my/skype/gdpr.py | 3 ++- my/spotify/gdpr.py | 3 ++- my/steam/scraper.py | 3 ++- my/todotxt/active.py | 3 ++- my/todotxt/git_history.py | 3 ++- my/trakt/export.py | 5 +++-- my/ttt.py | 3 ++- my/twitch/gdpr.py | 12 ++++-------- my/twitch/overrustle_logs.py | 12 ++++-------- my/zsh.py | 4 ++-- 36 files changed, 78 insertions(+), 63 deletions(-) diff --git a/my/activitywatch/active_window.py b/my/activitywatch/active_window.py index 0383324..4570d53 100644 --- a/my/activitywatch/active_window.py +++ b/my/activitywatch/active_window.py @@ -16,7 +16,8 @@ from functools import partial from itertools import chain -from my.core import get_files, Stats, Paths, dataclass, make_logger, make_config +from dataclasses import dataclass +from my.core import get_files, Stats, Paths, make_logger, make_config from my.utils.input_source import InputSource from more_itertools import unique_everseen diff --git a/my/apple/privacy_export.py b/my/apple/privacy_export.py index 96bab6f..fa1bb1c 100644 --- a/my/apple/privacy_export.py +++ b/my/apple/privacy_export.py @@ -7,7 +7,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import apple as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass +from dataclasses import dataclass +from my.core import PathIsh @dataclass @@ -29,7 +30,7 @@ class config(user_config.privacy_export): Element = Union[_Element, None] from my.core import Stats, Res, make_logger -from my.core.common import mcachew +from my.core.cachew import mcachew logger = make_logger(__name__) diff --git a/my/bash.py b/my/bash.py index 04e748b..4b29779 100644 --- a/my/bash.py +++ b/my/bash.py @@ -33,8 +33,9 @@ from more_itertools import unique_everseen -from my.core import get_files, Stats, make_logger, Paths, dataclass -from my.core.common import mcachew +from dataclasses import dataclass +from my.core import get_files, Stats, make_logger, Paths +from my.core.cachew import mcachew from my.utils.time import parse_datetime_sec from my.utils.input_source import InputSource diff --git a/my/blizzard/gdpr.py b/my/blizzard/gdpr.py index 4cc6d0d..f7d6d6c 100644 --- a/my/blizzard/gdpr.py +++ b/my/blizzard/gdpr.py @@ -5,8 +5,9 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import blizzard as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass, make_logger -from my.core.common import mcachew +from dataclasses import dataclass +from my.core import PathIsh, make_logger +from my.core.cachew import mcachew @dataclass diff --git a/my/chess/export.py b/my/chess/export.py index b429dfb..3617eca 100644 --- a/my/chess/export.py +++ b/my/chess/export.py @@ -17,8 +17,9 @@ import chess_export.lichess.model as lmodel from more_itertools import unique_everseen -from my.core import get_files, Stats, make_logger, Paths, dataclass -from my.core.common import mcachew +from dataclasses import dataclass +from my.core import get_files, Stats, make_logger, Paths +from my.core.cachew import mcachew from my.utils.input_source import InputSource diff --git a/my/discord/data_export.py b/my/discord/data_export.py index ac102bc..00a8265 100644 --- a/my/discord/data_export.py +++ b/my/discord/data_export.py @@ -10,10 +10,11 @@ from pathlib import Path from typing import List +from dataclasses import dataclass from my.config import discord as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass, make_config -from my.core.common import mcachew +from my.core import PathIsh, make_config +from my.core.cachew import mcachew @dataclass diff --git a/my/facebook/gdpr.py b/my/facebook/gdpr.py index 395e35f..7604c93 100644 --- a/my/facebook/gdpr.py +++ b/my/facebook/gdpr.py @@ -4,7 +4,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import facebook as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass +from dataclasses import dataclass +from my.core import PathIsh @dataclass diff --git a/my/grouvee/export.py b/my/grouvee/export.py index 31ff3c3..99c60f4 100644 --- a/my/grouvee/export.py +++ b/my/grouvee/export.py @@ -14,7 +14,8 @@ from more_itertools import last import grouvee_export.dal as G -from my.core import get_files, Stats, Paths, dataclass +from dataclasses import dataclass +from my.core import get_files, Stats, Paths @dataclass diff --git a/my/ip/discord.py b/my/ip/discord.py index a606c95..069fffc 100644 --- a/my/ip/discord.py +++ b/my/ip/discord.py @@ -4,7 +4,7 @@ from my.core import make_logger, Stats -from my.core.common import mcachew +from my.core.cachew import mcachew from my.core.source import import_source logger = make_logger(__name__) diff --git a/my/ip/facebook.py b/my/ip/facebook.py index c612b7b..d02226e 100644 --- a/my/ip/facebook.py +++ b/my/ip/facebook.py @@ -5,7 +5,7 @@ from my.core import make_logger, Stats from my.core.source import import_source -from my.core.common import mcachew +from my.core.cachew import mcachew logger = make_logger(__name__) diff --git a/my/ipython.py b/my/ipython.py index 6f63265..93364f6 100644 --- a/my/ipython.py +++ b/my/ipython.py @@ -22,7 +22,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import ipython as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/league/export.py b/my/league/export.py index be705a9..ca897b7 100644 --- a/my/league/export.py +++ b/my/league/export.py @@ -7,7 +7,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import league as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/linkedin/privacy_export.py b/my/linkedin/privacy_export.py index 73722b5..5767f68 100644 --- a/my/linkedin/privacy_export.py +++ b/my/linkedin/privacy_export.py @@ -8,7 +8,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import linkedin as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass +from dataclasses import dataclass +from my.core import PathIsh @dataclass diff --git a/my/listenbrainz/export.py b/my/listenbrainz/export.py index af67edc..58c6bbd 100644 --- a/my/listenbrainz/export.py +++ b/my/listenbrainz/export.py @@ -16,7 +16,8 @@ from listenbrainz_export.parse import Listen, iter_listens from more_itertools import unique_everseen -from my.core import get_files, Stats, make_logger, Paths, dataclass +from dataclasses import dataclass +from my.core import get_files, Stats, make_logger, Paths from my.utils.input_source import InputSource diff --git a/my/location/apple.py b/my/location/apple.py index 7140954..4946bba 100644 --- a/my/location/apple.py +++ b/my/location/apple.py @@ -1,6 +1,5 @@ from typing import Iterator -from my.core.common import Stats from my.core.source import import_source from my.location.common import Location # type: ignore[import] @@ -19,9 +18,3 @@ def locations() -> Iterator[Location]: elevation=None, datasource="apple", ) - - -def stats() -> Stats: - from my.core import stat - - return {**stat(locations)} diff --git a/my/mail/imap.py b/my/mail/imap.py index 7734aae..e3e1581 100644 --- a/my/mail/imap.py +++ b/my/mail/imap.py @@ -18,7 +18,8 @@ ) -from my.core import Stats, Paths, dataclass, get_files, make_config +from dataclasses import dataclass +from my.core import Stats, Paths, get_files, make_config from .common import Email, unique_mail diff --git a/my/mail/mbox.py b/my/mail/mbox.py index 0397a05..347ba5c 100644 --- a/my/mail/mbox.py +++ b/my/mail/mbox.py @@ -11,7 +11,8 @@ from pathlib import Path from typing import List, Iterator, Optional, Sequence, IO, Any -from my.core import Stats, Paths, dataclass, get_files +from dataclasses import dataclass +from my.core import Stats, Paths, get_files from my.core import make_logger from .common import Email, unique_mail, try_decode_buf diff --git a/my/mal/export.py b/my/mal/export.py index 148af5c..3921677 100644 --- a/my/mal/export.py +++ b/my/mal/export.py @@ -13,7 +13,8 @@ from typing import Iterator, List, Tuple, NamedTuple, Optional from functools import lru_cache -from my.core import Stats, make_logger, PathIsh, dataclass, make_config, get_files +from dataclasses import dataclass +from my.core import Stats, make_logger, PathIsh, make_config, get_files from my.core.structure import match_structure from malexport.paths import LocalDir diff --git a/my/minecraft/advancements.py b/my/minecraft/advancements.py index 34ef9a5..9052549 100644 --- a/my/minecraft/advancements.py +++ b/my/minecraft/advancements.py @@ -8,7 +8,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import minecraft as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/mpv/history_daemon.py b/my/mpv/history_daemon.py index ac76a0d..679313b 100644 --- a/my/mpv/history_daemon.py +++ b/my/mpv/history_daemon.py @@ -10,7 +10,8 @@ from my.config import mpv as user_config # type: ignore[attr-defined] from typing import Iterator, Sequence, Optional -from my.core import Paths, dataclass, make_config +from dataclasses import dataclass +from my.core import Paths, make_config @dataclass diff --git a/my/offline/listens.py b/my/offline/listens.py index 6a4bf0e..1f9a6b0 100644 --- a/my/offline/listens.py +++ b/my/offline/listens.py @@ -14,7 +14,8 @@ from offline_listens.listens import Listen from offline_listens.parse import iter_dir, parse_file -from my.core import get_files, Stats, Paths, dataclass +from dataclasses import dataclass +from my.core import get_files, Stats, Paths from my.utils.input_source import InputSource diff --git a/my/piazza/scraper.py b/my/piazza/scraper.py index b70c220..cde4f94 100644 --- a/my/piazza/scraper.py +++ b/my/piazza/scraper.py @@ -7,7 +7,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import piazza as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/project_euler.py b/my/project_euler.py index 5075ddb..1a98181 100644 --- a/my/project_euler.py +++ b/my/project_euler.py @@ -15,7 +15,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import project_euler as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/rss/newsboat/git_history.py b/my/rss/newsboat/git_history.py index 233fab8..950a825 100644 --- a/my/rss/newsboat/git_history.py +++ b/my/rss/newsboat/git_history.py @@ -22,7 +22,8 @@ Diff, ) -from my.core import Stats, PathIsh, dataclass +from dataclasses import dataclass +from my.core import Stats, PathIsh @dataclass diff --git a/my/runelite/screenshots.py b/my/runelite/screenshots.py index 75f5d83..e5b1c5c 100644 --- a/my/runelite/screenshots.py +++ b/my/runelite/screenshots.py @@ -7,7 +7,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import runelite as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/scramble/history.py b/my/scramble/history.py index 2d1e0e5..362e600 100644 --- a/my/scramble/history.py +++ b/my/scramble/history.py @@ -7,7 +7,8 @@ from pathlib import Path from typing import Optional -from my.core import dataclass, PathIsh, make_config +from dataclasses import dataclass +from my.core import PathIsh, make_config from my.config import scramble as user_config # type: ignore[attr-defined] diff --git a/my/skype/gdpr.py b/my/skype/gdpr.py index c324784..c53fc6e 100644 --- a/my/skype/gdpr.py +++ b/my/skype/gdpr.py @@ -12,7 +12,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import skype as user_config # type: ignore[attr-defined] -from my.core import Paths, Stats, dataclass +from dataclasses import dataclass +from my.core import Paths, Stats @dataclass diff --git a/my/spotify/gdpr.py b/my/spotify/gdpr.py index cd3dad5..482e6f8 100644 --- a/my/spotify/gdpr.py +++ b/my/spotify/gdpr.py @@ -5,7 +5,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import spotify as user_config # type: ignore[attr-defined] -from my.core import PathIsh, Stats, dataclass +from dataclasses import dataclass +from my.core import PathIsh, Stats @dataclass diff --git a/my/steam/scraper.py b/my/steam/scraper.py index 2940b46..3f7179b 100644 --- a/my/steam/scraper.py +++ b/my/steam/scraper.py @@ -5,7 +5,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import steam as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass diff --git a/my/todotxt/active.py b/my/todotxt/active.py index 9a0c871..e417e3e 100644 --- a/my/todotxt/active.py +++ b/my/todotxt/active.py @@ -15,7 +15,8 @@ Iterator, ) -from my.core import Stats, PathIsh, dataclass +from dataclasses import dataclass +from my.core import Stats, PathIsh from .common import Todo, TODOTXT_FILES, parse_todotxt_buffer diff --git a/my/todotxt/git_history.py b/my/todotxt/git_history.py index e8da8b0..14b8f67 100644 --- a/my/todotxt/git_history.py +++ b/my/todotxt/git_history.py @@ -19,7 +19,8 @@ from git_doc_history import DocHistory, parse_snapshot_diffs, Action -from my.core import Stats, PathIsh, dataclass +from dataclasses import dataclass +from my.core import Stats, PathIsh from .common import Todo, TODOTXT_FILES, parse_todotxt_buffer diff --git a/my/trakt/export.py b/my/trakt/export.py index 5ea732d..4fe4dcd 100644 --- a/my/trakt/export.py +++ b/my/trakt/export.py @@ -15,8 +15,9 @@ import traktexport.dal as D from traktexport.merge import read_and_merge_exports -from my.core import get_files, Stats, make_logger, Paths, dataclass -from my.core.common import mcachew +from dataclasses import dataclass +from my.core import get_files, Stats, make_logger, Paths +from my.core.cachew import mcachew @dataclass diff --git a/my/ttt.py b/my/ttt.py index a1e9402..bcf2ced 100644 --- a/my/ttt.py +++ b/my/ttt.py @@ -13,7 +13,8 @@ from more_itertools import unique_everseen -from my.core import get_files, Stats, Paths, dataclass +from dataclasses import dataclass +from my.core import get_files, Stats, Paths from my.utils.time import parse_datetime_sec from my.utils.input_source import InputSource diff --git a/my/twitch/gdpr.py b/my/twitch/gdpr.py index f72e8dc..8b02e20 100644 --- a/my/twitch/gdpr.py +++ b/my/twitch/gdpr.py @@ -6,7 +6,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import twitch as user_config # type: ignore[attr-defined] -from my.core import PathIsh, dataclass +from dataclasses import dataclass +from my.core import PathIsh @dataclass @@ -22,7 +23,8 @@ class config(user_config.gdpr): from .common import Event, Results from my.core import make_logger -from my.core.common import get_files, mcachew, Stats +from my.core.cachew import mcachew +from my.core.common import get_files from my.utils.input_source import InputSource logger = make_logger(__name__) @@ -57,9 +59,3 @@ def _parse_csv_file(p: Path) -> Iterator[Event]: channel=line[5], context=context, ) - - -def stats() -> Stats: - from my.core import stat - - return {**stat(events)} diff --git a/my/twitch/overrustle_logs.py b/my/twitch/overrustle_logs.py index 83fece3..d776fc3 100644 --- a/my/twitch/overrustle_logs.py +++ b/my/twitch/overrustle_logs.py @@ -6,7 +6,8 @@ # see https://github.com/purarue/dotfiles/blob/master/.config/my/my/config/__init__.py for an example from my.config import twitch as user_config # type: ignore[attr-defined] -from my.core import Paths, dataclass +from dataclasses import dataclass +from my.core import Paths @dataclass @@ -19,7 +20,8 @@ class config(user_config.overrustle): from typing import Sequence, List from my.core import make_logger -from my.core.common import get_files, mcachew, Stats +from my.core.cachew import mcachew +from my.core.common import get_files from my.utils.time import parse_datetime_sec from my.utils.input_source import InputSource @@ -50,9 +52,3 @@ def _parse_json_dump(p: Path) -> Results: channel=blob["channel"], context=blob["message"], ) - - -def stats() -> Stats: - from my.core import stat - - return {**stat(events)} diff --git a/my/zsh.py b/my/zsh.py index e4ab07f..dbe993b 100644 --- a/my/zsh.py +++ b/my/zsh.py @@ -28,6 +28,7 @@ from typing import Sequence, Optional from functools import lru_cache +from dataclasses import dataclass from my.core import ( get_files, warn_if_empty, @@ -35,9 +36,8 @@ make_logger, PathIsh, Paths, - dataclass, ) -from my.core.common import mcachew +from my.core.cachew import mcachew from my.core.warnings import low from my.utils.time import parse_datetime_sec from my.utils.input_source import InputSource