def cat(self):
"""
Prints a catalogue of the files stored in the UEF file.
"""
# Catalogue command
if self.contents == []:
print 'No files'
else:
print 'Contents:'
file_number = 0
for file in self.contents:
# Converts non printable characters in the filename
# to ? symbols
new_name = self.printable(file['name'])
print string.expandtabs(string.ljust(str(file_number), 3)+': '+
string.ljust(new_name, 16)+
string.upper(
string.ljust(hex(file['load'])[2:], 10) +'\t'+
string.ljust(hex(file['exec'])[2:], 10) +'\t'+
string.ljust(hex(len(file['data']))[2:], 6)
) +'\t'+
'chunks %i to %i' % (file['position'], file['last position']) )
file_number = file_number + 1
评论列表
文章目录