Skip to content

Commit

Permalink
type updates from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
purarue committed Oct 25, 2024
1 parent 7c3b53d commit 0269d2d
Show file tree
Hide file tree
Showing 36 changed files with 78 additions and 63 deletions.
3 changes: 2 additions & 1 deletion my/activitywatch/active_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions my/apple/privacy_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__)
Expand Down
5 changes: 3 additions & 2 deletions my/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions my/blizzard/gdpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions my/chess/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
5 changes: 3 additions & 2 deletions my/discord/data_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/facebook/gdpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/grouvee/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion my/ip/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
2 changes: 1 addition & 1 deletion my/ip/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
3 changes: 2 additions & 1 deletion my/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/league/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/linkedin/privacy_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/listenbrainz/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 0 additions & 7 deletions my/location/apple.py
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -19,9 +18,3 @@ def locations() -> Iterator[Location]:
elevation=None,
datasource="apple",
)


def stats() -> Stats:
from my.core import stat

return {**stat(locations)}
3 changes: 2 additions & 1 deletion my/mail/imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion my/mail/mbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/mal/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/minecraft/advancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/mpv/history_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/offline/listens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion my/piazza/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/project_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/rss/newsboat/git_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
Diff,
)

from my.core import Stats, PathIsh, dataclass
from dataclasses import dataclass
from my.core import Stats, PathIsh


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion my/runelite/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/scramble/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
3 changes: 2 additions & 1 deletion my/skype/gdpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/spotify/gdpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/steam/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/todotxt/active.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion my/todotxt/git_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
5 changes: 3 additions & 2 deletions my/trakt/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion my/ttt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 4 additions & 8 deletions my/twitch/gdpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__)
Expand Down Expand Up @@ -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)}
Loading

0 comments on commit 0269d2d

Please sign in to comment.