🚚 Remove enums

This commit is contained in:
洛水居室 2023-12-27 15:09:24 +08:00
parent 052ea7a233
commit 9dd8b98f7c
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
36 changed files with 38 additions and 38 deletions

View File

@ -1,5 +1,5 @@
from simnet.client.genshin import GenshinClient from simnet.client.genshin import GenshinClient
from simnet.client.starrail import StarRailClient from simnet.client.starrail import StarRailClient
from simnet.utils.enum_ import Game, Region from simnet.utils.enums import Game, Region
__all__ = ("StarRailClient", "GenshinClient", "Game", "Region") __all__ = ("StarRailClient", "GenshinClient", "Game", "Region")

View File

@ -9,7 +9,7 @@ from simnet.client.cookies import Cookies
from simnet.client.headers import Headers from simnet.client.headers import Headers
from simnet.errors import TimedOut, NetworkError, BadRequest, raise_for_ret_code, NotSupported from simnet.errors import TimedOut, NetworkError, BadRequest, raise_for_ret_code, NotSupported
from simnet.utils.ds import generate_dynamic_secret, DSType, hex_digest from simnet.utils.ds import generate_dynamic_secret, DSType, hex_digest
from simnet.utils.enum_ import Region, Game from simnet.utils.enums import Region, Game
from simnet.utils.types import ( from simnet.utils.types import (
RT, RT,
HeaderTypes, HeaderTypes,

View File

@ -13,7 +13,7 @@ from simnet.client.routes import (
URL, URL,
) )
from simnet.errors import RegionNotSupported from simnet.errors import RegionNotSupported
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.player import recognize_game_biz, recognize_server from simnet.utils.player import recognize_game_biz, recognize_server
__all__ = ("AuthClient",) __all__ = ("AuthClient",)

View File

@ -12,7 +12,7 @@ from simnet.models.genshin.calculator import (
CalculatorCharacterDetails, CalculatorCharacterDetails,
CalculatorTalent, CalculatorTalent,
) )
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.player import recognize_genshin_server from simnet.utils.player import recognize_genshin_server

View File

@ -4,7 +4,7 @@ from simnet.client.base import BaseClient
from simnet.client.routes import RECORD_URL from simnet.client.routes import RECORD_URL
from simnet.errors import DataNotPublic from simnet.errors import DataNotPublic
from simnet.models.lab.record import RecordCard from simnet.models.lab.record import RecordCard
from simnet.utils.enum_ import Region, Game from simnet.utils.enums import Region, Game
from simnet.utils.types import QueryParamTypes from simnet.utils.types import QueryParamTypes
__all__ = ("BaseChronicleClient",) __all__ = ("BaseChronicleClient",)

View File

@ -13,7 +13,7 @@ from simnet.models.genshin.chronicle.stats import (
FullGenshinUserStats, FullGenshinUserStats,
) )
from simnet.models.lab.record import RecordCard from simnet.models.lab.record import RecordCard
from simnet.utils.enum_ import Game, Region from simnet.utils.enums import Game, Region
from simnet.utils.player import recognize_genshin_server, recognize_region from simnet.utils.player import recognize_genshin_server, recognize_region
__all__ = ("GenshinBattleChronicleClient",) __all__ = ("GenshinBattleChronicleClient",)

View File

@ -13,7 +13,7 @@ from simnet.models.starrail.chronicle.notes import StarRailNote, StarRailNoteWid
from simnet.models.starrail.chronicle.resident import StarRailResident from simnet.models.starrail.chronicle.resident import StarRailResident
from simnet.models.starrail.chronicle.rogue import StarRailRogue, StarRailRogueLocust from simnet.models.starrail.chronicle.rogue import StarRailRogue, StarRailRogueLocust
from simnet.models.starrail.chronicle.stats import StarRailUserStats, StarRailUserInfo from simnet.models.starrail.chronicle.stats import StarRailUserStats, StarRailUserInfo
from simnet.utils.enum_ import Game, Region from simnet.utils.enums import Game, Region
from simnet.utils.player import recognize_starrail_server, recognize_region from simnet.utils.player import recognize_starrail_server, recognize_region
__all__ = ("StarRailBattleChronicleClient",) __all__ = ("StarRailBattleChronicleClient",)

View File

@ -8,7 +8,7 @@ from simnet.client.base import BaseClient
from simnet.client.routes import REWARD_URL from simnet.client.routes import REWARD_URL
from simnet.errors import GeetestTriggered from simnet.errors import GeetestTriggered
from simnet.models.lab.daily import DailyRewardInfo, DailyReward, ClaimedDailyReward from simnet.models.lab.daily import DailyRewardInfo, DailyReward, ClaimedDailyReward
from simnet.utils.enum_ import Game, Region from simnet.utils.enums import Game, Region
from simnet.utils.player import recognize_genshin_server, recognize_starrail_server from simnet.utils.player import recognize_genshin_server, recognize_starrail_server
__all__ = ("DailyRewardClient",) __all__ = ("DailyRewardClient",)

View File

@ -5,7 +5,7 @@ from simnet.client.base import BaseClient
from simnet.client.routes import DETAIL_LEDGER_URL, INFO_LEDGER_URL from simnet.client.routes import DETAIL_LEDGER_URL, INFO_LEDGER_URL
from simnet.models.diary import DiaryType from simnet.models.diary import DiaryType
from simnet.models.genshin.diary import DiaryPage from simnet.models.genshin.diary import DiaryPage
from simnet.utils.enum_ import Region, Game from simnet.utils.enums import Region, Game
from simnet.utils.player import recognize_server from simnet.utils.player import recognize_server
__all__ = ("BaseDiaryClient",) __all__ = ("BaseDiaryClient",)

View File

@ -2,7 +2,7 @@ from typing import Optional
from simnet.client.components.diary.base import BaseDiaryClient from simnet.client.components.diary.base import BaseDiaryClient
from simnet.models.genshin.diary import Diary from simnet.models.genshin.diary import Diary
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
class GenshinDiaryClient(BaseDiaryClient): class GenshinDiaryClient(BaseDiaryClient):

View File

@ -2,7 +2,7 @@ from typing import Optional
from simnet.client.components.diary.base import BaseDiaryClient from simnet.client.components.diary.base import BaseDiaryClient
from simnet.models.starrail.diary import StarRailDiary from simnet.models.starrail.diary import StarRailDiary
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
class StarrailDiaryClient(BaseDiaryClient): class StarrailDiaryClient(BaseDiaryClient):

View File

@ -6,7 +6,7 @@ from simnet.client.headers import Headers
from simnet.client.routes import TAKUMI_URL, HK4E_URL, CODE_URL, CODE_HOYOLAB_URL from simnet.client.routes import TAKUMI_URL, HK4E_URL, CODE_URL, CODE_HOYOLAB_URL
from simnet.models.lab.announcement import Announcement from simnet.models.lab.announcement import Announcement
from simnet.models.lab.record import PartialUser, FullUser, Account from simnet.models.lab.record import PartialUser, FullUser, Account
from simnet.utils.enum_ import Region, Game from simnet.utils.enums import Region, Game
from simnet.utils.lang import create_short_lang_code from simnet.utils.lang import create_short_lang_code
from simnet.utils.player import recognize_genshin_server, recognize_server, recognize_game_biz from simnet.utils.player import recognize_genshin_server, recognize_server, recognize_game_biz
from simnet.utils.types import HeaderTypes from simnet.utils.types import HeaderTypes

View File

@ -8,7 +8,7 @@ from httpx import Headers
from simnet.client.base import BaseClient from simnet.client.base import BaseClient
from simnet.client.routes import URL from simnet.client.routes import URL
from simnet.errors import RegionNotSupported from simnet.errors import RegionNotSupported
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
class VerifyClient(BaseClient): class VerifyClient(BaseClient):

View File

@ -3,7 +3,7 @@ from urllib.parse import unquote
from simnet.client.base import BaseClient from simnet.client.base import BaseClient
from simnet.client.routes import GACHA_INFO_URL from simnet.client.routes import GACHA_INFO_URL
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
from simnet.utils.lang import create_short_lang_code from simnet.utils.lang import create_short_lang_code
__all__ = ("BaseWishClient",) __all__ = ("BaseWishClient",)

View File

@ -3,7 +3,7 @@ from typing import Optional, List
from simnet.client.components.wish.base import BaseWishClient from simnet.client.components.wish.base import BaseWishClient
from simnet.models.genshin.wish import Wish from simnet.models.genshin.wish import Wish
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
from simnet.utils.paginator import WishPaginator from simnet.utils.paginator import WishPaginator
__all__ = ("GenshinWishClient",) __all__ = ("GenshinWishClient",)

View File

@ -3,7 +3,7 @@ from typing import Optional, List
from simnet.client.components.wish.base import BaseWishClient from simnet.client.components.wish.base import BaseWishClient
from simnet.models.starrail.wish import StarRailWish from simnet.models.starrail.wish import StarRailWish
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
from simnet.utils.paginator import WishPaginator from simnet.utils.paginator import WishPaginator
__all__ = ("StarRailWishClient",) __all__ = ("StarRailWishClient",)

View File

@ -9,7 +9,7 @@ from simnet.client.components.lab import LabClient
from simnet.client.components.transaction import TransactionClient from simnet.client.components.transaction import TransactionClient
from simnet.client.components.verify import VerifyClient from simnet.client.components.verify import VerifyClient
from simnet.client.components.wish.genshin import GenshinWishClient from simnet.client.components.wish.genshin import GenshinWishClient
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
__all__ = ("GenshinClient",) __all__ = ("GenshinClient",)

View File

@ -9,7 +9,7 @@ from simnet.client.components.lab import LabClient
from simnet.client.components.transaction import TransactionClient from simnet.client.components.transaction import TransactionClient
from simnet.client.components.verify import VerifyClient from simnet.client.components.verify import VerifyClient
from simnet.client.components.wish.genshin import GenshinWishClient from simnet.client.components.wish.genshin import GenshinWishClient
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.types import CookieTypes, HeaderTypes, TimeoutTypes from simnet.utils.types import CookieTypes, HeaderTypes, TimeoutTypes
class GenshinClient( class GenshinClient(

View File

@ -4,7 +4,7 @@ from urllib.parse import urljoin
from httpx import URL as _URL from httpx import URL as _URL
from simnet.errors import RegionNotSupported, NotSupported from simnet.errors import RegionNotSupported, NotSupported
from simnet.utils.enum_ import Region, Game from simnet.utils.enums import Region, Game
URLTypes = Union["URL", str] URLTypes = Union["URL", str]

View File

@ -7,7 +7,7 @@ from simnet.client.components.diary.starrail import StarrailDiaryClient
from simnet.client.components.lab import LabClient from simnet.client.components.lab import LabClient
from simnet.client.components.verify import VerifyClient from simnet.client.components.verify import VerifyClient
from simnet.client.components.wish.starrail import StarRailWishClient from simnet.client.components.wish.starrail import StarRailWishClient
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
__all__ = ("StarRailClient",) __all__ = ("StarRailClient",)

View File

@ -7,7 +7,7 @@ from simnet.client.components.diary.starrail import StarrailDiaryClient
from simnet.client.components.lab import LabClient from simnet.client.components.lab import LabClient
from simnet.client.components.verify import VerifyClient from simnet.client.components.verify import VerifyClient
from simnet.client.components.wish.starrail import StarRailWishClient from simnet.client.components.wish.starrail import StarRailWishClient
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.types import CookieTypes, HeaderTypes, TimeoutTypes from simnet.utils.types import CookieTypes, HeaderTypes, TimeoutTypes
class StarRailClient( class StarRailClient(

View File

@ -5,7 +5,7 @@ from typing import Optional, Any, Dict, List, Union, Type
from pydantic import Field, validator from pydantic import Field, validator
from simnet.models.base import APIModel from simnet.models.base import APIModel
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
__all__ = ( __all__ = (
"FullUser", "FullUser",

View File

@ -6,7 +6,7 @@ import time
from enum import Enum from enum import Enum
from typing import Any, Optional from typing import Any, Optional
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.types import QueryParamTypes from simnet.utils.types import QueryParamTypes
MIYOUSHE_VERSION = "2.66.1" MIYOUSHE_VERSION = "2.66.1"

View File

@ -2,7 +2,7 @@
from typing import Optional, Mapping, Sequence from typing import Optional, Mapping, Sequence
from simnet.utils.enum_ import Game, Region from simnet.utils.enums import Game, Region
UID_RANGE: Mapping[Game, Mapping[Region, Sequence[int]]] = { UID_RANGE: Mapping[Game, Mapping[Region, Sequence[int]]] = {
Game.GENSHIN: { Game.GENSHIN: {

View File

@ -9,7 +9,7 @@ from dotenv import load_dotenv
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.cookies import parse_cookie from simnet.utils.cookies import parse_cookie
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
env_path = Path(".env") env_path = Path(".env")
if env_path.exists(): if env_path.exists():

View File

@ -4,7 +4,7 @@ import pytest
import pytest_asyncio import pytest_asyncio
from simnet.client.components.auth import AuthClient from simnet.client.components.auth import AuthClient
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
from simnet.utils.player import recognize_genshin_server, recognize_genshin_game_biz from simnet.utils.player import recognize_genshin_server, recognize_genshin_game_biz
if TYPE_CHECKING: if TYPE_CHECKING:

View File

@ -7,7 +7,7 @@ from simnet.client.components.chronicle.base import BaseChronicleClient
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -4,11 +4,11 @@ import pytest
import pytest_asyncio import pytest_asyncio
from simnet.client.genshin import GenshinClient from simnet.client.genshin import GenshinClient
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -8,7 +8,7 @@ from simnet.models.genshin.chronicle.stats import FullGenshinUserStats, Stats
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -8,7 +8,7 @@ from simnet.client.components.chronicle.genshin import GenshinBattleChronicleCli
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -7,7 +7,7 @@ from simnet.client.components.diary.genshin import GenshinDiaryClient
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -4,11 +4,11 @@ import pytest
import pytest_asyncio import pytest_asyncio
from simnet.client.components.lab import LabClient from simnet.client.components.lab import LabClient
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -4,11 +4,11 @@ import pytest
import pytest_asyncio import pytest_asyncio
from simnet.client.starrail import StarRailClient from simnet.client.starrail import StarRailClient
from simnet.utils.enum_ import Game from simnet.utils.enums import Game
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -8,7 +8,7 @@ from simnet.errors import NeedChallenge
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture

View File

@ -7,7 +7,7 @@ from simnet.client.components.diary.starrail import StarrailDiaryClient
if TYPE_CHECKING: if TYPE_CHECKING:
from simnet.client.cookies import Cookies from simnet.client.cookies import Cookies
from simnet.utils.enum_ import Region from simnet.utils.enums import Region
@pytest_asyncio.fixture @pytest_asyncio.fixture