inventory_views.py 文件源码

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

项目:optf2 作者: Lagg 项目源码 文件源码
def GET(self, user):
        baseurl = user.strip('/').split('/')
        if len(baseurl) > 0:
            user = baseurl[-1]

        if not user:
            raise steam.items.InventoryError("Need an ID")

        try:
            prof = models.user(user).load()
            ctx = models.sim_context(prof).load()
            for ct in (ctx or []):
                ct.setdefault("inventory_logo", '')

            return template.sim_selector(prof, ctx)
        except steam.items.InventoryError as E:
            raise web.NotFound(template.errors.generic("Failed to load backpack ({0})".format(E)))
        except steam.user.ProfileError as E:
            raise web.NotFound(template.errors.generic("Failed to load profile ({0})".format(E)))
        except steam.api.HTTPError as E:
            raise web.NotFound(template.errors.generic("Couldn't connect to Steam (HTTP {0})".format(E)))
        except models.CacheEmptyError as E:
            raise web.NotFound(template.errors.generic(E))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号