Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion zimsoap/zobjects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections.abc import Mapping

""" Zimbra specific objects, handle (un)parsing to/from XML and other glue-code

Expand All @@ -18,7 +19,7 @@ class NotEnoughInformation(Exception):
pass


class ZObject(object):
class ZObject(Mapping, object):
""" An abstract class to handle Zimbra Concepts

A ZObject map to a tag name (subclasses have to define cls.TAG_NAME) :
Expand Down Expand Up @@ -90,6 +91,12 @@ def __getitem__(self, k):
def __setitem__(self, k, v):
self._a_tags[k] = utils.auto_type(v)

def __iter__(self):
return iter(self._a_tags)

def __len__(self):
return len(self._a_tags)

def __repr__(self):
most_significant_id = getattr(self, 'id',
hex(id(self)))
Expand Down