Added clear() method to nattributehandler. Resolves #542.

This commit is contained in:
Griatch 2014-08-05 09:05:44 +02:00
parent 55cbe615e9
commit 5d08d3b3fb

View file

@ -517,7 +517,7 @@ class NickHandler(AttributeHandler):
class NAttributeHandler(object):
"""
This stand-alone handler manages non-database saving.
It is consistent with AttributeHandler and is used
It is similar to AttributeHandler and is used
by the .ndb handler in the same way as .db does
for the AttributeHandler.
"""
@ -545,6 +545,10 @@ class NAttributeHandler(object):
del self._store[key]
self.obj.set_recache_protection(self._store)
def clear(self):
"Remove all nattributes from handler"
self._store = {}
def all(self, return_tuples=False):
"List all keys or (keys, values) stored, except _keys"
if return_tuples: