mirror of
https://github.com/elliotnunn/machfs.git
synced 2024-11-22 04:31:37 +00:00
Better str(File)
This commit is contained in:
parent
ac4bedcf53
commit
925fd13cd3
@ -90,7 +90,9 @@ class File:
|
||||
self.data = bytearray()
|
||||
|
||||
def __str__(self):
|
||||
return 'File %r/%r data=%db rsrc=%db' % (self.type, self.creator, len(self.data), len(self.rsrc))
|
||||
typestr, creatorstr = (x.decode('mac_roman') for x in (self.type, self.creator))
|
||||
dstr, rstr = (repr(bytes(x)) if 1 <= len(x) <= 32 else '%db' % len(x) for x in (self.data, self.rsrc))
|
||||
return '[%s/%s] data=%s rsrc=%s' % (typestr, creatorstr, dstr, rstr)
|
||||
|
||||
|
||||
class Volume(directory.AbstractFolder):
|
||||
|
Loading…
Reference in New Issue
Block a user