notification.py 文件源码

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

项目:Monocle 作者: Noctem 项目源码 文件源码
def create(self, stats=conf.IMAGE_STATS):
        if self.time_of_day > 1:
            bg = resource_stream('monocle', 'static/monocle-icons/assets/notification-bg-night.png')
        else:
            bg = resource_stream('monocle', 'static/monocle-icons/assets/notification-bg-day.png')
        ims = cairo.ImageSurface.create_from_png(bg)
        self.context = cairo.Context(ims)
        pokepic = resource_stream('monocle', 'static/monocle-icons/original-icons/{}.png'.format(self.pokemon_id))
        if stats:
            self.draw_stats()
        self.draw_image(pokepic, 204, 224)
        self.draw_name(50 if stats else 120)
        image = TemporaryFile(suffix='.png')
        ims.write_to_png(image)
        return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号