comparison src/memory/memory.py @ 504:65ecbb473cbb

core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard: - bridge: new bridge method getEntityData and signal entityDataUpdated - core: entityDataUpdated signal sent on new string data - quick frontend: fixed avatars/vcard infos, fixed _replace in quick_contact_list - plugin xep-0054: dropped updatedValue signal, use entities data instead
author Goffi <goffi@goffi.org>
date Wed, 26 Sep 2012 01:23:56 +0200
parents 385cd2169eb5
children f98bef71a918
comparison
equal deleted inserted replaced
503:10119c2a9d33 504:65ecbb473cbb
718 raise exceptions.UnknownProfileError(_('Trying to get entity data for a non-existant profile')) 718 raise exceptions.UnknownProfileError(_('Trying to get entity data for a non-existant profile'))
719 if not profile in self.entitiesCache: 719 if not profile in self.entitiesCache:
720 raise exceptions.ProfileNotInCacheError 720 raise exceptions.ProfileNotInCacheError
721 entity_data = self.entitiesCache[profile].setdefault(entity_jid.userhost(),{}) 721 entity_data = self.entitiesCache[profile].setdefault(entity_jid.userhost(),{})
722 entity_data[key] = value 722 entity_data[key] = value
723 if isinstance(value,basestring):
724 self.host.bridge.entityDataUpdated(entity_jid.userhost(), key, value, profile)
723 725
724 def getEntityData(self, entity_jid, keys_list, profile_key): 726 def getEntityData(self, entity_jid, keys_list, profile_key):
725 """Get a list of cached values for entity 727 """Get a list of cached values for entity
726 @param entity_jid: JID of the entity 728 @param entity_jid: JID of the entity
727 @param keys_list: list of keys to get, empty list for everything 729 @param keys_list: list of keys to get, empty list for everything
728 @param profile_key: %(doc_profile_key)s 730 @param profile_key: %(doc_profile_key)s
729 @return: dict withs values for each key in keys_list. 731 @return: dict withs values for each key in keys_list.
730 if there is no value of a given key, resultint dict will 732 if there is no value of a given key, resulting dict will
731 have nothing with that key nether 733 have nothing with that key nether
732 @raise: exceptions.UnknownEntityError if entity is not in cache 734 @raise: exceptions.UnknownEntityError if entity is not in cache
733 exceptions.ProfileNotInCacheError if profile is not in cache 735 exceptions.ProfileNotInCacheError if profile is not in cache
734 """ 736 """
735 profile = self.getProfileName(profile_key) 737 profile = self.getProfileName(profile_key)