diff --git a/bemani/frontend/bishi/bishi.py b/bemani/frontend/bishi/bishi.py index eeeb7c1..0ac0a3f 100644 --- a/bemani/frontend/bishi/bishi.py +++ b/bemani/frontend/bishi/bishi.py @@ -12,7 +12,7 @@ from bemani.frontend.base import FrontendBase class BishiBashiFrontend(FrontendBase): - game = GameConstants.BISHI_BASHI + game: GameConstants = GameConstants.BISHI_BASHI def __init__(self, data: Data, config: Config, cache: Cache) -> None: super().__init__(data, config, cache) diff --git a/bemani/frontend/ddr/ddr.py b/bemani/frontend/ddr/ddr.py index 444b24b..dc74f6c 100644 --- a/bemani/frontend/ddr/ddr.py +++ b/bemani/frontend/ddr/ddr.py @@ -1,6 +1,6 @@ # vim: set fileencoding=utf-8 import copy -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from bemani.backend.ddr import DDRFactory, DDRBase from bemani.common import Profile, ValidatedDict, GameConstants, VersionConstants @@ -10,11 +10,11 @@ from bemani.frontend.base import FrontendBase class DDRFrontend(FrontendBase): - game = GameConstants.DDR + game: GameConstants = GameConstants.DDR - version = 0 # We use a virtual version for DDR to tie charts together + version: int = 0 # We use a virtual version for DDR to tie charts together - valid_charts = [ + valid_charts: List[int] = [ DDRBase.CHART_SINGLE_BEGINNER, DDRBase.CHART_SINGLE_BASIC, DDRBase.CHART_SINGLE_DIFFICULT, @@ -26,9 +26,9 @@ class DDRFrontend(FrontendBase): DDRBase.CHART_DOUBLE_CHALLENGE, ] - valid_rival_types = [f'friend_{i}' for i in range(10)] + valid_rival_types: List[str] = [f'friend_{i}' for i in range(10)] - max_active_rivals = { + max_active_rivals: Dict[int, int] = { VersionConstants.DDR_X2: 1, VersionConstants.DDR_X3_VS_2NDMIX: 3, VersionConstants.DDR_2013: 3, diff --git a/bemani/frontend/iidx/iidx.py b/bemani/frontend/iidx/iidx.py index ba38847..4589dfa 100644 --- a/bemani/frontend/iidx/iidx.py +++ b/bemani/frontend/iidx/iidx.py @@ -11,9 +11,9 @@ from bemani.frontend.base import FrontendBase class IIDXFrontend(FrontendBase): - game = GameConstants.IIDX + game: GameConstants = GameConstants.IIDX - valid_charts = [ + valid_charts: List[int] = [ IIDXBase.CHART_TYPE_N7, IIDXBase.CHART_TYPE_H7, IIDXBase.CHART_TYPE_A7, @@ -22,7 +22,7 @@ class IIDXFrontend(FrontendBase): IIDXBase.CHART_TYPE_A14, ] - valid_rival_types = [ + valid_rival_types: List[str] = [ 'sp_rival', 'dp_rival', ] diff --git a/bemani/frontend/jubeat/jubeat.py b/bemani/frontend/jubeat/jubeat.py index b2749e8..907cfad 100644 --- a/bemani/frontend/jubeat/jubeat.py +++ b/bemani/frontend/jubeat/jubeat.py @@ -1,5 +1,5 @@ # vim: set fileencoding=utf-8 -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from bemani.backend.jubeat import JubeatFactory, JubeatBase from bemani.common import Profile, ValidatedDict, GameConstants, VersionConstants @@ -9,15 +9,15 @@ from bemani.frontend.base import FrontendBase class JubeatFrontend(FrontendBase): - game = GameConstants.JUBEAT + game: GameConstants = GameConstants.JUBEAT - valid_charts = [ + valid_charts: List[int] = [ JubeatBase.CHART_TYPE_BASIC, JubeatBase.CHART_TYPE_ADVANCED, JubeatBase.CHART_TYPE_EXTREME, ] - valid_rival_types = ['rival'] + valid_rival_types: List[str] = ['rival'] def all_games(self) -> Iterator[Tuple[GameConstants, int, str]]: yield from JubeatFactory.all_games() diff --git a/bemani/frontend/mga/mga.py b/bemani/frontend/mga/mga.py index 39f1096..d3c5283 100644 --- a/bemani/frontend/mga/mga.py +++ b/bemani/frontend/mga/mga.py @@ -12,7 +12,7 @@ from bemani.frontend.base import FrontendBase class MetalGearArcadeFrontend(FrontendBase): - game = GameConstants.MGA + game: GameConstants = GameConstants.MGA def __init__(self, data: Data, config: Config, cache: Cache) -> None: super().__init__(data, config, cache) diff --git a/bemani/frontend/museca/museca.py b/bemani/frontend/museca/museca.py index 915b47e..355c88c 100644 --- a/bemani/frontend/museca/museca.py +++ b/bemani/frontend/museca/museca.py @@ -1,5 +1,5 @@ # vim: set fileencoding=utf-8 -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from flask_caching import Cache # type: ignore @@ -11,9 +11,9 @@ from bemani.frontend.base import FrontendBase class MusecaFrontend(FrontendBase): - game = GameConstants.MUSECA + game: GameConstants = GameConstants.MUSECA - valid_charts = [ + valid_charts: List[int] = [ MusecaBase.CHART_TYPE_GREEN, MusecaBase.CHART_TYPE_ORANGE, MusecaBase.CHART_TYPE_RED, diff --git a/bemani/frontend/popn/popn.py b/bemani/frontend/popn/popn.py index 08b9cef..36e8b59 100644 --- a/bemani/frontend/popn/popn.py +++ b/bemani/frontend/popn/popn.py @@ -1,5 +1,5 @@ # vim: set fileencoding=utf-8 -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from bemani.backend.popn import PopnMusicFactory, PopnMusicBase from bemani.common import Profile, ValidatedDict, GameConstants, VersionConstants @@ -9,18 +9,18 @@ from bemani.frontend.base import FrontendBase class PopnMusicFrontend(FrontendBase): - game = GameConstants.POPN_MUSIC + game: GameConstants = GameConstants.POPN_MUSIC - valid_charts = [ + valid_charts: List[int] = [ PopnMusicBase.CHART_TYPE_EASY, PopnMusicBase.CHART_TYPE_NORMAL, PopnMusicBase.CHART_TYPE_HYPER, PopnMusicBase.CHART_TYPE_EX, ] - valid_rival_types = ['rival'] + valid_rival_types: List[str] = ['rival'] - max_active_rivals = { + max_active_rivals: Dict[int, int] = { # Technically there is support for Rivals in Tune Street but I # couldn't get it booting anymore to test. VersionConstants.POPN_MUSIC_TUNE_STREET: 0, diff --git a/bemani/frontend/reflec/endpoints.py b/bemani/frontend/reflec/endpoints.py index 99e9fc1..6dd3f31 100644 --- a/bemani/frontend/reflec/endpoints.py +++ b/bemani/frontend/reflec/endpoints.py @@ -1,6 +1,7 @@ # vim: set fileencoding=utf-8 import re -from typing import Any, Dict +from typing import Any, Dict, List +from typing_extensions import Final from flask import Blueprint, request, Response, url_for, abort from bemani.common import ID, GameConstants @@ -20,7 +21,7 @@ reflec_pages = Blueprint( static_folder=static_location, ) -NO_RIVAL_SUPPORT = [1] +NO_RIVAL_SUPPORT: Final[List[int]] = [1] @reflec_pages.route('/scores') diff --git a/bemani/frontend/reflec/reflec.py b/bemani/frontend/reflec/reflec.py index b6e6f97..5ca0586 100644 --- a/bemani/frontend/reflec/reflec.py +++ b/bemani/frontend/reflec/reflec.py @@ -1,5 +1,5 @@ # vim: set fileencoding=utf-8 -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from flask_caching import Cache # type: ignore @@ -11,18 +11,18 @@ from bemani.frontend.base import FrontendBase class ReflecBeatFrontend(FrontendBase): - game = GameConstants.REFLEC_BEAT + game: GameConstants = GameConstants.REFLEC_BEAT - version = 0 # We use a virtual version for ReflecBeat to tie charts together + version: int = 0 # We use a virtual version for ReflecBeat to tie charts together - valid_charts = [ + valid_charts: List[int] = [ ReflecBeatBase.CHART_TYPE_BASIC, ReflecBeatBase.CHART_TYPE_MEDIUM, ReflecBeatBase.CHART_TYPE_HARD, ReflecBeatBase.CHART_TYPE_SPECIAL, ] - valid_rival_types = [ + valid_rival_types: List[str] = [ 'rival', ] diff --git a/bemani/frontend/sdvx/sdvx.py b/bemani/frontend/sdvx/sdvx.py index 9ce0df7..26d6252 100644 --- a/bemani/frontend/sdvx/sdvx.py +++ b/bemani/frontend/sdvx/sdvx.py @@ -1,5 +1,5 @@ # vim: set fileencoding=utf-8 -from typing import Any, Dict, Iterator, Tuple +from typing import Any, Dict, Iterator, List, Tuple from flask_caching import Cache # type: ignore @@ -11,9 +11,9 @@ from bemani.frontend.base import FrontendBase class SoundVoltexFrontend(FrontendBase): - game = GameConstants.SDVX + game: GameConstants = GameConstants.SDVX - valid_charts = [ + valid_charts: List[int] = [ SoundVoltexBase.CHART_TYPE_NOVICE, SoundVoltexBase.CHART_TYPE_ADVANCED, SoundVoltexBase.CHART_TYPE_EXHAUST, @@ -21,7 +21,7 @@ class SoundVoltexFrontend(FrontendBase): SoundVoltexBase.CHART_TYPE_MAXIMUM, ] - valid_rival_types = [ + valid_rival_types: List[str] = [ 'rival', ]