Commit d0f9a9b4 authored by Jim Fulton's avatar Jim Fulton

Gave delay objects a repr for debugging purposes.

parent c9116c71
...@@ -44,17 +44,25 @@ class Delay: ...@@ -44,17 +44,25 @@ class Delay:
the mainloop from sending a response. the mainloop from sending a response.
""" """
msgid = conn = sent = None
def set_sender(self, msgid, conn): def set_sender(self, msgid, conn):
self.msgid = msgid self.msgid = msgid
self.conn = conn self.conn = conn
def reply(self, obj): def reply(self, obj):
self.sent = 'reply'
self.conn.send_reply(self.msgid, obj) self.conn.send_reply(self.msgid, obj)
def error(self, exc_info): def error(self, exc_info):
self.sent = 'error'
log("Error raised in delayed method", logging.ERROR, exc_info=True) log("Error raised in delayed method", logging.ERROR, exc_info=True)
self.conn.return_error(self.msgid, *exc_info[:2]) self.conn.return_error(self.msgid, *exc_info[:2])
def __repr__(self):
return "%s[%s, %r, %r, %r]" % (
self.__class__.__name__, id(self), self.msgid, self.conn, self.sent)
class Result(Delay): class Result(Delay):
def __init__(self, *args): def __init__(self, *args):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment