From 7fabfe9cb9a01148135d639ec9f558fff6d73cd6 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 20 Mar 2016 15:59:29 -0700 Subject: [PATCH] Add __repr__s for ClientDescriptor and AsyncDjangoHandler. --- zerver/lib/event_queue.py | 3 +++ zerver/management/commands/runtornado.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/zerver/lib/event_queue.py b/zerver/lib/event_queue.py index 9337564f2c..f3f1045af0 100644 --- a/zerver/lib/event_queue.py +++ b/zerver/lib/event_queue.py @@ -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: diff --git a/zerver/management/commands/runtornado.py b/zerver/management/commands/runtornado.py index 463bb9a058..01382ea090 100644 --- a/zerver/management/commands/runtornado.py +++ b/zerver/management/commands/runtornado.py @@ -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'])