fix typing across multiple games, fixes #23
This commit is contained in:
parent
da422e602b
commit
d60f827000
@ -4,7 +4,7 @@ from datetime import datetime, timedelta
|
||||
from time import strftime
|
||||
|
||||
import pytz
|
||||
from typing import Dict, Any
|
||||
from typing import Dict, Any, List
|
||||
|
||||
from core.config import CoreConfig
|
||||
from titles.chuni.const import ChuniConstants
|
||||
@ -401,7 +401,7 @@ class ChuniBase:
|
||||
"userItemList": [],
|
||||
}
|
||||
|
||||
items: list[Dict[str, Any]] = []
|
||||
items: List[Dict[str, Any]] = []
|
||||
for i in range(next_idx, len(user_item_list)):
|
||||
tmp = user_item_list[i]._asdict()
|
||||
tmp.pop("user")
|
||||
|
@ -296,7 +296,7 @@ class ChuniItemData(BaseData):
|
||||
self,
|
||||
version: int,
|
||||
room_id: int,
|
||||
matching_member_info_list: list,
|
||||
matching_member_info_list: List,
|
||||
user_id: int = None,
|
||||
rest_sec: int = 60,
|
||||
is_full: bool = False
|
||||
|
@ -2,7 +2,7 @@ import logging
|
||||
import json
|
||||
from decimal import Decimal
|
||||
from base64 import b64encode
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, List
|
||||
from hashlib import md5
|
||||
from datetime import datetime
|
||||
|
||||
@ -416,7 +416,7 @@ class CxbBase:
|
||||
self.logger.info(f"Get best rankings for {uid}")
|
||||
p = self.data.score.get_best_rankings(uid)
|
||||
|
||||
rankList: list[Dict[str, Any]] = []
|
||||
rankList: List[Dict[str, Any]] = []
|
||||
|
||||
for rank in p:
|
||||
if rank["song_id"] is not None:
|
||||
|
@ -1,5 +1,5 @@
|
||||
from datetime import datetime, date, timedelta
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, List
|
||||
import logging
|
||||
|
||||
from core.config import CoreConfig
|
||||
@ -466,7 +466,7 @@ class Mai2Base:
|
||||
next_idx = int(data["nextIndex"] % 10000000000)
|
||||
user_item_list = self.data.item.get_items(data["userId"], kind)
|
||||
|
||||
items: list[Dict[str, Any]] = []
|
||||
items: List[Dict[str, Any]] = []
|
||||
for i in range(next_idx, len(user_item_list)):
|
||||
tmp = user_item_list[i]._asdict()
|
||||
tmp.pop("user")
|
||||
|
@ -320,7 +320,7 @@ class Mai2DX(Mai2Base):
|
||||
next_idx = int(data["nextIndex"] % 10000000000)
|
||||
user_item_list = self.data.item.get_items(data["userId"], kind)
|
||||
|
||||
items: list[Dict[str, Any]] = []
|
||||
items: List[Dict[str, Any]] = []
|
||||
for i in range(next_idx, len(user_item_list)):
|
||||
tmp = user_item_list[i]._asdict()
|
||||
tmp.pop("user")
|
||||
|
@ -180,7 +180,7 @@ class Mai2Universe(Mai2DX):
|
||||
extend = extend._asdict()
|
||||
# parse the selectedCardList
|
||||
# 6 = Freedom Pass, 4 = Gold Pass (cardTypeId)
|
||||
selected_cards: list = extend["selectedCardList"]
|
||||
selected_cards: List = extend["selectedCardList"]
|
||||
|
||||
# if no pass is already added, add the corresponding pass
|
||||
if not user_card["cardTypeId"] in selected_cards:
|
||||
|
@ -268,7 +268,7 @@ class OngekiBase:
|
||||
}
|
||||
|
||||
def handle_get_game_id_list_api_request(self, data: Dict) -> Dict:
|
||||
game_idlist: list[str, Any] = [] # 1 to 230 & 8000 to 8050
|
||||
game_idlist: List[str, Any] = [] # 1 to 230 & 8000 to 8050
|
||||
|
||||
if data["type"] == 1:
|
||||
for i in range(1, 231):
|
||||
@ -443,7 +443,7 @@ class OngekiBase:
|
||||
"userItemList": [],
|
||||
}
|
||||
|
||||
items: list[Dict[str, Any]] = []
|
||||
items: List[Dict[str, Any]] = []
|
||||
for i in range(data["nextIndex"] % 10000000000, len(p)):
|
||||
if len(items) > data["maxCount"]:
|
||||
break
|
||||
|
@ -8,12 +8,12 @@ from titles.wacca.handlers.helpers import Notice
|
||||
class GetNewsResponseV1(BaseResponse):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.notices: list[Notice] = []
|
||||
self.copywrightListings: list[str] = []
|
||||
self.stoppedSongs: list[int] = []
|
||||
self.stoppedJackets: list[int] = []
|
||||
self.stoppedMovies: list[int] = []
|
||||
self.stoppedIcons: list[int] = []
|
||||
self.notices: List[Notice] = []
|
||||
self.copywrightListings: List[str] = []
|
||||
self.stoppedSongs: List[int] = []
|
||||
self.stoppedJackets: List[int] = []
|
||||
self.stoppedMovies: List[int] = []
|
||||
self.stoppedIcons: List[int] = []
|
||||
|
||||
def make(self) -> Dict:
|
||||
note = []
|
||||
@ -34,7 +34,7 @@ class GetNewsResponseV1(BaseResponse):
|
||||
|
||||
|
||||
class GetNewsResponseV2(GetNewsResponseV1):
|
||||
stoppedProducts: list[int] = []
|
||||
stoppedProducts: List[int] = []
|
||||
|
||||
def make(self) -> Dict:
|
||||
super().make()
|
||||
@ -44,8 +44,8 @@ class GetNewsResponseV2(GetNewsResponseV1):
|
||||
|
||||
|
||||
class GetNewsResponseV3(GetNewsResponseV2):
|
||||
stoppedNavs: list[int] = []
|
||||
stoppedNavVoices: list[int] = []
|
||||
stoppedNavs: List[int] = []
|
||||
stoppedNavVoices: List[int] = []
|
||||
|
||||
def make(self) -> Dict:
|
||||
super().make()
|
||||
|
Loading…
Reference in New Issue
Block a user