Fix lint and typing messages with latest libraries.

This commit is contained in:
Jennifer Taylor
2022-03-18 04:32:04 +00:00
parent 90f3d9e138
commit 8098825387
6 changed files with 29 additions and 29 deletions

View File

@@ -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))

View File

@@ -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)

View File

@@ -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

View File

@@ -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__':

View File

@@ -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__':

View File

@@ -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!")