from common import zeroconf class Roster: def __init__(self, zeroconf): self._data = {} self.zeroconf = zeroconf # our zeroconf instance def getRoster(self): print 'getRoster in Roster' self._data = self.zeroconf.get_contacts() return self def getItem(self, jid): print 'getItem(%s) in Roster' % jid if self._data.has_key(jid): return self._data[jid] def setItem(self, item): print 'setItem in Roster: jid: %s' % item # data is maybe not already resolved # what data is expected here? self._data[item] = self.zeroconf.get_contact(item) def __getitem__(self,item): print '__getitem__ in Roster' return self._data[item] def getRaw(self): print 'getRaw in Roster' return self._data def getResources(self, jid): print 'getResources(%s) in Roster' % jid # return self ''' delItem(jid) getStatus(jid) getPriority(jid) getShow(jid) '''