Skip to content

Commit

Permalink
Merge branch 'master' into feature/pure-fiction
Browse files Browse the repository at this point in the history
  • Loading branch information
KT-Yeh committed Jan 28, 2024
2 parents 8b1ef57 + 4788f5d commit 698af23
Show file tree
Hide file tree
Showing 77 changed files with 86 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ignore =
S101, S303, S311, S324,
W503,

# Recommended by black
extend-ignore = E203, E704

# F401: unused import.
# F403: cannot detect unused vars if we use starred import
# D10*: docstrings
Expand Down
1 change: 1 addition & 0 deletions genshin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Source Code: https://github.com/thesadru/genshin.py
"""

from . import models, utility
from .client import *
from .constants import *
Expand Down
1 change: 1 addition & 0 deletions genshin/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI tools."""

import asyncio
import datetime
import functools
Expand Down
1 change: 1 addition & 0 deletions genshin/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Default client implementation."""

from . import components
from .cache import *
from .clients import *
Expand Down
1 change: 1 addition & 0 deletions genshin/client/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cache for client."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions genshin/client/clients.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A simple HTTP client for API endpoints."""

from .components import (
calculator,
chronicle,
Expand Down
1 change: 1 addition & 0 deletions genshin/client/compatibility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reverse-compatibility layer for previous versions."""

from __future__ import annotations

import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base ABC Client."""

import abc
import asyncio
import base64
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/calculator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Calculator client."""

from .client import *
1 change: 1 addition & 0 deletions genshin/client/components/calculator/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Over-engineered for the sake of extendability and maintainability.
"""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/calculator/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Calculator client."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/chronicle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Battle chronicle client components."""

from .client import *
1 change: 1 addition & 0 deletions genshin/client/components/chronicle/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Battle chronicle component."""

from . import genshin, honkai, starrail

__all__ = ["BattleChronicleClient"]
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/chronicle/starrail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""StarRail battle chronicle component."""

import asyncio
import typing

Expand Down
7 changes: 3 additions & 4 deletions genshin/client/components/daily.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Daily reward component."""

import asyncio
import datetime
import functools
Expand Down Expand Up @@ -150,8 +151,7 @@ async def claim_daily_reward( # noqa: D102 missing docstring in overload?
lang: typing.Optional[str] = None,
reward: typing.Literal[True] = ...,
challenge: typing.Optional[typing.Mapping[str, str]] = None,
) -> models.DailyReward:
...
) -> models.DailyReward: ...

@typing.overload
async def claim_daily_reward( # noqa: D102 missing docstring in overload?
Expand All @@ -161,8 +161,7 @@ async def claim_daily_reward( # noqa: D102 missing docstring in overload?
lang: typing.Optional[str] = None,
reward: typing.Literal[False],
challenge: typing.Optional[typing.Mapping[str, str]] = None,
) -> None:
...
) -> None: ...

async def claim_daily_reward(
self,
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/diary.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Diary component."""

import datetime
import functools
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/gacha.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wish component."""

import asyncio
import functools
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/geetest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
Credits to M-307 - https://github.com/mrwan200
"""

from .client import *
1 change: 1 addition & 0 deletions genshin/client/components/geetest/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Geetest client component."""

import json
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/geetest/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Aiohttp webserver used for captcha solving and email verification."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/hoyolab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Hoyolab component."""

import asyncio
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/lineup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Lineup component."""

import functools
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/teapot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Teapot component."""

import functools
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/client/components/transaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transaction client."""

import functools
import typing
import urllib.parse
Expand Down
16 changes: 6 additions & 10 deletions genshin/client/components/wiki.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wiki component."""

import typing

from genshin import types
Expand Down Expand Up @@ -34,44 +35,39 @@ async def get_wiki_previews( # noqa: D102 missing docstring in overload?
menu: typing.Literal[models.WikiPageType.CHARACTER],
*,
lang: typing.Optional[str] = None,
) -> typing.Sequence[models.CharacterPreview]:
...
) -> typing.Sequence[models.CharacterPreview]: ...

@typing.overload
async def get_wiki_previews( # noqa: D102 missing docstring in overload?
self,
menu: typing.Literal[models.WikiPageType.WEAPON],
*,
lang: typing.Optional[str] = None,
) -> typing.Sequence[models.WeaponPreview]:
...
) -> typing.Sequence[models.WeaponPreview]: ...

@typing.overload
async def get_wiki_previews( # noqa: D102 missing docstring in overload?
self,
menu: typing.Literal[models.WikiPageType.ARTIFACT],
*,
lang: typing.Optional[str] = None,
) -> typing.Sequence[models.ArtifactPreview]:
...
) -> typing.Sequence[models.ArtifactPreview]: ...

@typing.overload
async def get_wiki_previews( # noqa: D102 missing docstring in overload?
self,
menu: typing.Literal[models.WikiPageType.ENEMY],
*,
lang: typing.Optional[str] = None,
) -> typing.Sequence[models.EnemyPreview]:
...
) -> typing.Sequence[models.EnemyPreview]: ...

@typing.overload
async def get_wiki_previews( # noqa: D102 missing docstring in overload?
self,
menu: int,
*,
lang: typing.Optional[str] = None,
) -> typing.Sequence[models.BaseWikiPreview]:
...
) -> typing.Sequence[models.BaseWikiPreview]: ...

async def get_wiki_previews(
self,
Expand Down
1 change: 1 addition & 0 deletions genshin/client/manager/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Cookie managers."""

from .cookie import *
from .managers import *
1 change: 1 addition & 0 deletions genshin/client/manager/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- stoken (v2) + mid -> ltoken_v2 (token_type=2)
- stoken (v2) + mid -> cookie_token_v2 (token_type=4)
"""

from __future__ import annotations

import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/client/manager/managers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cookie managers for making authenticated requests."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions genshin/client/ratelimit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ratelimit handlers."""

import asyncio
import functools
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/client/routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API routes."""

import abc
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants hardcoded for optimizations."""

from . import types

__all__ = ["LANGS"]
Expand Down
1 change: 1 addition & 0 deletions genshin/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Errors received from the API."""

import typing

__all__ = [
Expand Down
1 change: 1 addition & 0 deletions genshin/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API models."""

from .genshin import *
from .honkai import *
from .hoyolab import *
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin models."""

from .calculator import *
from .character import *
from .chronicle import *
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/calculator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin calculator models."""

from __future__ import annotations

import collections
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/chronicle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Battle chronicle models."""

from .abyss import *
from .activities import *
from .characters import *
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/chronicle/activities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Chronicle activities models."""

import datetime
import re
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/chronicle/notes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin chronicle notes."""

import datetime
import enum
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/chronicle/tcg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin serenitea pot replica display models."""

from __future__ import annotations

import enum
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin model constants."""

import typing

__all__ = ["CHARACTER_NAMES", "DBChar"]
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/daily.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Daily reward models."""

import calendar
import datetime
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/diary.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin diary models."""

import datetime
import enum
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/gacha.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin wish models."""

import datetime
import enum
import re
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/lineup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin lineup models."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/teapot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin serenitea pot replica display models."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions genshin/models/genshin/wiki.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genshin wish models."""

import enum
import json
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/honkai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai models."""

from .battlesuit import *
from .chronicle import *
from .constants import *
1 change: 1 addition & 0 deletions genshin/models/honkai/battlesuit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai battlesuit model."""

import logging
import re
import typing
Expand Down
1 change: 1 addition & 0 deletions genshin/models/honkai/chronicle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Battle chronicle models."""

from .battlesuits import *
from .modes import *
from .stats import *
1 change: 1 addition & 0 deletions genshin/models/honkai/chronicle/battlesuits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai chronicle battlesuits."""

import re
import typing

Expand Down
1 change: 1 addition & 0 deletions genshin/models/honkai/chronicle/modes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai battle chronicle models."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions genshin/models/honkai/chronicle/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai stats models."""

import typing

if typing.TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions genshin/models/honkai/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Honkai model constants."""

import typing

__all__ = ["BATTLESUIT_IDENTIFIERS"]
Expand Down
1 change: 1 addition & 0 deletions genshin/models/hoyolab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Hoyolab models."""

from .announcements import *
from .private import *
from .record import *
Loading

0 comments on commit 698af23

Please sign in to comment.