From a5966a6382565f9c63d691ca752a2136b0a3ccb1 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Wed, 11 Nov 2020 05:14:36 +0000 Subject: [PATCH] Fix some lint and typing issues uncovered by mypy/flake8 upgrades. --- bemani/client/reflec/groovin.py | 4 ++-- bemani/frontend/app.py | 2 +- bemani/utils/afputils.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bemani/client/reflec/groovin.py b/bemani/client/reflec/groovin.py index 58d72e4..5f99f93 100644 --- a/bemani/client/reflec/groovin.py +++ b/bemani/client/reflec/groovin.py @@ -1,6 +1,6 @@ import random import time -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, cast from bemani.client.base import BaseClient from bemani.protocol import Node @@ -729,7 +729,7 @@ class ReflecBeatGroovinUpper(BaseClient): 'time': 54321, }, ], - key=lambda ep: ep['id'], + key=lambda ep: cast(int, ep['id']), ) self.verify_player_rb4write(ref_id, location, episodes=dummyepisodes) episodes = sorted( diff --git a/bemani/frontend/app.py b/bemani/frontend/app.py index d81bbb5..0da006d 100644 --- a/bemani/frontend/app.py +++ b/bemani/frontend/app.py @@ -257,7 +257,7 @@ def navigation() -> Dict[str, Any]: 'components': components, 'any': jinja2_any, } - pages = [] + pages: List[Dict[str, Any]] = [] # Landing page pages.append( diff --git a/bemani/utils/afputils.py b/bemani/utils/afputils.py index 72af523..351a9bb 100644 --- a/bemani/utils/afputils.py +++ b/bemani/utils/afputils.py @@ -641,9 +641,9 @@ class AFPFile: vprint("Bit 0x000010 - regionmapping; NOT PRESENT") if feature_mask & 0x20: - vprint(f"Bit 0x000020 - text obfuscation on") + vprint("Bit 0x000020 - text obfuscation on") else: - vprint(f"Bit 0x000020 - text obfuscation off") + vprint("Bit 0x000020 - text obfuscation off") if feature_mask & 0x40: # Two unknown bytes, first is a length or a count. Secound is