display.py 文件源码

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

项目:sshchan 作者: einchan 项目源码 文件源码
def parse_post(self, post):
        """Read post JSON and return values in easily-readable dictionary."""
        # Old json - without name field
        if len(post) == 3:
            parsed_post = {
                "name": "Anonymous",
                "stamp": self.convert_time(post[0]),
                "id": str(post[1]),
                "text": ur.Text(post[2])
            }
        else:
            parsed_post = {
                "name": post[0],
                "stamp": self.convert_time(post[1]),
                "id": str(post[2]),
                "text": ur.Text(post[3])
            }

        return parsed_post
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号