X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/3660782f64b0e3dfc2db4b1bfce4c59b4b46e3fc..865ddb235489f38afd7043ee269e4f958474bd5a:/pymin/services/util.py?ds=sidebyside diff --git a/pymin/services/util.py b/pymin/services/util.py index b665c00..2fe7f9b 100644 --- a/pymin/services/util.py +++ b/pymin/services/util.py @@ -721,6 +721,13 @@ class ContainerSubHandler(SubHandler): except IndexError: raise ItemNotFoundError(index) + @handler(u'Remove all items (use with care).') + def clear(self): + if isinstance(self._attr(), dict): + self._attr.clear() + else: + self._attr(list()) + @handler(u'Get information about an item') def get(self, index): r"get(index) -> item :: List all the information of an item."