X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-jsonrpclib.git/blobdiff_plain/669c1369c82b5dec6fd7952dce27a41ac1690b11..a0cd6268562129127ef26cf22391d0a41ed2f05f:/jsonrpclib/history.py diff --git a/jsonrpclib/history.py b/jsonrpclib/history.py index ec53235..d11863d 100644 --- a/jsonrpclib/history.py +++ b/jsonrpclib/history.py @@ -1,4 +1,3 @@ - class History(object): """ This holds all the response and request objects for a @@ -8,6 +7,13 @@ class History(object): """ requests = [] responses = [] + _instance = None + + @classmethod + def instance(cls): + if not cls._instance: + cls._instance = cls() + return cls._instance def add_response(self, response_obj): self.responses.append(response_obj) @@ -32,5 +38,3 @@ class History(object): def clear(self): del self.requests[:] del self.responses[:] - -history = History()