get rid of more app references

This commit is contained in:
j 2014-08-09 19:06:06 +02:00
parent abf2bbf6a8
commit fc4ccb8083
1 changed files with 5 additions and 5 deletions

View File

@ -91,7 +91,7 @@ class Icons(dict):
icons = Icons(icons_db_path) icons = Icons(icons_db_path)
@run_async @run_async
def get_icon(app, id, type_, size, callback): def get_icon(id, type_, size, callback):
if size: if size:
skey = '%s:%s:%s' % (type_, id, size) skey = '%s:%s:%s' % (type_, id, size)
data = icons[skey] data = icons[skey]
@ -120,7 +120,7 @@ def get_icon(app, id, type_, size, callback):
callback(data) callback(data)
@run_async @run_async
def get_icon_app(app, id, type_, size, callback): def get_icon_app(id, type_, size, callback):
with db.session(): with db.session():
from item.models import Item from item.models import Item
item = Item.get(id) item = Item.get(id)
@ -151,8 +151,8 @@ def get_icon_app(app, id, type_, size, callback):
class IconHandler(tornado.web.RequestHandler): class IconHandler(tornado.web.RequestHandler):
def initialize(self, app): def initialize(self):
self._app = app pass
@tornado.web.asynchronous @tornado.web.asynchronous
@tornado.gen.coroutine @tornado.gen.coroutine
@ -166,7 +166,7 @@ class IconHandler(tornado.web.RequestHandler):
self.set_header('Content-Type', 'image/jpeg') self.set_header('Content-Type', 'image/jpeg')
response = yield tornado.gen.Task(get_icon, self._app, id, type_, size) response = yield tornado.gen.Task(get_icon, id, type_, size)
if not response: if not response:
self.set_status(404) self.set_status(404)
return return