X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-jsonrpclib.git/blobdiff_plain/9cb9396c901daeeb9bf47675bbce707671b5e6af..1cb797f048ae5131a01086a93d87952c03e8abe7:/jsonrpclib/history.py diff --git a/jsonrpclib/history.py b/jsonrpclib/history.py index ec53235..e6a01cf 100644 --- a/jsonrpclib/history.py +++ b/jsonrpclib/history.py @@ -8,6 +8,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 +39,3 @@ class History(object): def clear(self): del self.requests[:] del self.responses[:] - -history = History()