def loadtoc(self):
"""
Overridable.
Default: After magic comes an int (4 byte native) giving the
position of the TOC within self.lib.
Default: The TOC is a marshal-able string.
"""
self.lib.seek(self.start + self.TOCPOS)
(offset,) = struct.unpack('!i', self.lib.read(4))
self.lib.seek(self.start + offset)
# Use marshal.loads() since load() arg must be a file object
# Convert the read list into a dict for faster access
self.toc = dict(marshal.loads(self.lib.read()))
######## This is what is called by FuncImporter #######
## Since an Archive is flat, we ignore parent and modname.
#XXX obsolete - imputil only code
## def get_code(self, parent, modname, fqname):
## pass
####### Core method - Override as needed #########
评论列表
文章目录