Random fixes

Everything else that was wrong or was making the linter unhappy
This commit is contained in:
Imanol-Mikel Barba Sabariego 2023-07-06 19:54:15 +02:00
parent 0585bea704
commit 7d9ba4e893
4 changed files with 5 additions and 4 deletions

View File

@ -337,7 +337,7 @@ def do_rename(cmd, mc, opts, args, opterr):
mc.rename(args[0], args[1])
def _get_ps2_title(mc, enc):
s = mc.get_icon_sys(".");
s = mc.get_icon_sys(".")
if s == None:
return None
a = ps2save.unpack_icon_sys(s)

View File

@ -1236,7 +1236,7 @@ class ps2mc(object):
if dirloc in self.open_files:
raise io_error(EBUSY,
"cannot remove open file", filename)
"cannot remove open file", name)
epc = self.entries_per_cluster

View File

@ -12,6 +12,7 @@ _SCCS_ID = "@(#) mymc ps2mc_dir.py 1.4 12/10/04 19:11:08\n"
import struct
import time
import calendar
import os
PS2MC_DIRENT_LENGTH = 512

View File

@ -369,14 +369,14 @@ class ps2_save_file(object):
off = 0
for i in range(dirlen):
if len(s) - off < 36:
raise eof(f)
raise eof(self.f)
(l, name) = struct.unpack("<L32s", s[off : off + 36])
name = zero_terminate(name)
# print("%08x %08x %s" % (off, l, name))
off += 36
data = s[off : off + l]
if len(data) != l:
raise eof(f)
raise eof(self.f)
self.set_file(i,
(DF_RWX | DF_FILE | DF_0400 | DF_EXISTS,
0, l, timestamp, 0, 0, timestamp, 0,