Add __repr__s for ClientDescriptor and AsyncDjangoHandler.

This commit is contained in:
Tim Abbott 2016-03-20 15:59:29 -07:00
parent 0b96e5e43f
commit 7fabfe9cb9
2 changed files with 6 additions and 0 deletions

View File

@ -90,6 +90,9 @@ class ClientDescriptor(object):
narrow=self.narrow,
client_type=self.client_type_name)
def __repr__(self):
return "ClientDescriptor<%s>" % (self.event_queue.id,)
@classmethod
def from_dict(cls, d):
if 'user_profile_email' not in d:

View File

@ -155,6 +155,9 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler):
# be cleared when the handler finishes its response
allocate_handler_id(self)
def __repr__(self):
return "AsyncDjangoHandler<%s, %s>" % (self.handler_id, get_descriptor_by_handler_id(self.handler_id))
def get(self, *args, **kwargs):
environ = WSGIContainer.environ(self.request)
environ['PATH_INFO'] = urllib.parse.unquote(environ['PATH_INFO'])