diff options
Diffstat (limited to 'jsonrpclib/history.py')
-rw-r--r-- | jsonrpclib/history.py | 9 |
1 files changed, 7 insertions, 2 deletions
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() |