diff --git a/bemani/backend/iidx/pendual.py b/bemani/backend/iidx/pendual.py index 82cf054..50bbeaa 100644 --- a/bemani/backend/iidx/pendual.py +++ b/bemani/backend/iidx/pendual.py @@ -1228,7 +1228,7 @@ class IIDXPendual(IIDXCourse, IIDXBase): # Ranking details in title screen rankingcharts = [] - for (mid, plays) in self.data.local.music.get_hit_chart(self.game, self.music_version, 20): + for (mid, _plays) in self.data.local.music.get_hit_chart(self.game, self.music_version, 20): rankingcharts.append(mid) root.add_child(Node.u16_array('monthly_mranking', rankingcharts)) root.add_child(Node.u16_array('total_mranking', rankingcharts)) diff --git a/bemani/common/pe.py b/bemani/common/pe.py index 2c63aa3..18b997c 100644 --- a/bemani/common/pe.py +++ b/bemani/common/pe.py @@ -206,12 +206,12 @@ class PEFile: else: raise JumpException(destination, f"Jumping to {hex(destination)} which is outside of our evaluation range!") - formatter = Formatter(FormatterSyntax.NASM) # type: ignore + formatter = Formatter(FormatterSyntax.NASM) while loc < len(chunk): inst = chunk[loc] loc = loc + 1 - mnemonic = formatter.format_mnemonic(inst, FormatMnemonicOptions.NO_PREFIXES) # type: ignore + mnemonic = formatter.format_mnemonic(inst, FormatMnemonicOptions.NO_PREFIXES) if mnemonic == "mov": dest = formatter.format_operand(inst, 0) diff --git a/bemani/data/data.py b/bemani/data/data.py index 3b62673..c25a608 100644 --- a/bemani/data/data.py +++ b/bemani/data/data.py @@ -1,7 +1,7 @@ import os import alembic.config -from alembic.migration import MigrationContext # type: ignore +from alembic.migration import MigrationContext from alembic.autogenerate import compare_metadata # type: ignore from sqlalchemy import create_engine # type: ignore from sqlalchemy.orm import scoped_session # type: ignore diff --git a/bemani/utils/arcutils.py b/bemani/utils/arcutils.py index d670c24..b740ac7 100644 --- a/bemani/utils/arcutils.py +++ b/bemani/utils/arcutils.py @@ -30,9 +30,9 @@ def main() -> None: root = root + '/' root = os.path.realpath(root) - fp = open(args.file, 'rb') - data = fp.read() - fp.close() + rfp = open(args.file, 'rb') + data = rfp.read() + rfp.close() arc = ARC(data) for fn in arc.filenames: @@ -43,8 +43,8 @@ def main() -> None: realfn = os.path.join(root, fn) dirof = os.path.dirname(realfn) os.makedirs(dirof, exist_ok=True) - with open(realfn, 'wb') as fp: - fp.write(arc.read_file(fn)) + with open(realfn, 'wb') as wfp: + wfp.write(arc.read_file(fn)) if __name__ == '__main__': diff --git a/bemani/utils/iidxutils.py b/bemani/utils/iidxutils.py index 746be1a..9b3fc8e 100644 --- a/bemani/utils/iidxutils.py +++ b/bemani/utils/iidxutils.py @@ -22,9 +22,9 @@ def main() -> None: ) args = parser.parse_args() - fp = open(args.infile, 'rb') - data = fp.read() - fp.close() + rfp = open(args.infile, 'rb') + data = rfp.read() + rfp.close() db = IIDXMusicDB(data) if args.hide_leggendarias: @@ -38,9 +38,9 @@ def main() -> None: song.folder = 0x5C print('Generating new database file...') - fp = open(args.outfile, 'wb') - fp.write(db.get_new_db()) - fp.close() + wfp = open(args.outfile, 'wb') + wfp.write(db.get_new_db()) + wfp.close() if __name__ == '__main__': diff --git a/bemani/utils/twodxutils.py b/bemani/utils/twodxutils.py index c80741e..2accc2c 100644 --- a/bemani/utils/twodxutils.py +++ b/bemani/utils/twodxutils.py @@ -43,9 +43,9 @@ def main() -> None: root = root + '/' root = os.path.realpath(root) - fp = open(args.file, 'rb') - data = fp.read() - fp.close() + rfp = open(args.file, 'rb') + data = rfp.read() + rfp.close() twodx = TwoDX(data) @@ -54,13 +54,13 @@ def main() -> None: realfn = os.path.join(root, fn) dirof = os.path.dirname(realfn) os.makedirs(dirof, exist_ok=True) - with open(realfn, 'wb') as fp: - fp.write(twodx.read_file(fn)) + with open(realfn, 'wb') as wfp: + wfp.write(twodx.read_file(fn)) elif len(args.wavfile) > 0: try: - fp = open(args.file, 'rb') - data = fp.read() - fp.close() + rfp = open(args.file, 'rb') + data = rfp.read() + rfp.close() twodx = TwoDX(data) except FileNotFoundError: @@ -71,15 +71,15 @@ def main() -> None: twodx.set_name(os.path.splitext(os.path.basename(args.file))[0]) for fn in args.wavfile: - fp = open(fn, 'rb') - data = fp.read() - fp.close() + rfp = open(fn, 'rb') + data = rfp.read() + rfp.close() twodx.write_file(os.path.basename(fn), data) - fp = open(args.file, 'wb') - fp.write(twodx.get_new_data()) - fp.close() + wfp = open(args.file, 'wb') + wfp.write(twodx.get_new_data()) + wfp.close() else: raise Exception("Please provide either a directory to extract to, or a wav file to build into a 2dx file!")