mirror of
https://github.com/ps2dev/mymc.git
synced 2025-02-17 18:59:20 +01:00
Random fixes
Everything else that was wrong or was making the linter unhappy
This commit is contained in:
parent
0585bea704
commit
7d9ba4e893
2
mymc.py
2
mymc.py
@ -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)
|
||||
|
2
ps2mc.py
2
ps2mc.py
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user