mailbox.py 文件源码

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

项目:kinect-2-libras 作者: inessadl 项目源码 文件源码
def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        subpath = self._lookup(key)
        f = open(os.path.join(self._path, subpath), 'r')
        try:
            if self._factory:
                msg = self._factory(f)
            else:
                msg = MaildirMessage(f)
        finally:
            f.close()
        subdir, name = os.path.split(subpath)
        msg.set_subdir(subdir)
        if self.colon in name:
            msg.set_info(name.split(self.colon)[-1])
        msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
        return msg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号