def _filetype_instance(self):
"""
Instantiates a new instance of the given :class:`FileType` (using
`self.matched_header`) and stores the result in `self.captured_files`
and creates a reference to that location at the current cursor location.
"""
ref = self.file_counter.next()
logging.debug("_filetype_instance(%s)" % repr(ref))
# Before doing anything else we need to mark the current cursor
# location as belonging to our file
self.screen[self.cursorY][self.cursorX] = ref
# Create an instance of the filetype we can reference
filetype_instance = self.magic_map[self.matched_header](
path=self.temppath,
linkpath=self.linkpath,
icondir=self.icondir)
self.captured_files[ref] = filetype_instance
评论列表
文章目录