def GET(self, app, iid):
user = None
markup.init_theme(app)
try:
sitems = models.schema(scope = app).processed_items
item = sitems[iid]
if web.input().get("contents"):
contents = item.get("contents")
if contents:
item = contents
except steam.api.HTTPError as E:
raise web.NotFound(template.errors.generic("Couldn't connect to Steam (HTTP {0})".format(E)))
except steam.items.SchemaError as E:
raise web.NotFound(template.errors.generic("Couldn't open schema: {0}".format(E)))
except KeyError:
raise web.NotFound(template.item_error_notfound(iid))
except models.CacheEmptyError as E:
raise web.NotFound(template.errors.generic(E))
except models.ItemBackendUnimplemented:
raise web.NotFound(template.errors.generic("No backend found to handle the given item, this could mean that the item has no available associated schema (yet)"))
caps = markup.get_capability_strings(item.get("caps", []))
try:
assets = models.assets(scope = app).price_map
price = markup.generate_item_price_string(item, assets)
except models.CacheEmptyError:
price = None
# Strip off quality prefix for possessive name
itemname = item["mainname"]
if itemname.startswith("The "):
item["ownedname"] = itemname[4:]
else:
item["ownedname"] = itemname
return template.item(app, user, item, price = price, caps = caps)
评论列表
文章目录