terminal.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:TerminalView 作者: Wramberg 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号