comparison tools/memory.py @ 64:d46f849664aa

SàT: multi-profile, plugins updated - core: 2 new convenient methods: getJidNStream and getClient - new param in plugin info: "handler" to know if there is a handler to plug on profiles clients - plugins with handler now use an other class which is returned to profile client with the new method "getHandler" and pluged when connecting
author Goffi <goffi@goffi.org>
date Sat, 30 Jan 2010 16:17:33 +1100
parents 0db25931b60d
children d35c5edab53f
comparison
equal deleted inserted replaced
63:0db25931b60d 64:d46f849664aa
222 profile = self.getProfileName(profile_key) 222 profile = self.getProfileName(profile_key)
223 if not profile: 223 if not profile:
224 error('Requesting a param for an non-existant profile') 224 error('Requesting a param for an non-existant profile')
225 return None 225 return None
226 226
227 return self.__getParam(profile, category, name) or node[1].getAttribute(attr) 227 if attr == "value":
228 return self.__getParam(profile, category, name) or node[1].getAttribute(attr)
229 else:
230 return node[1].getAttribute(attr)
228 231
229 232
230 def __getParam(self, profile, category, name, type='individual'): 233 def __getParam(self, profile, category, name, type='individual'):
231 """Return the param, or None if it doesn't exist 234 """Return the param, or None if it doesn't exist
232 @param profile: the profile name (not profile key, i.e. name and not something like @DEFAULT@) 235 @param profile: the profile name (not profile key, i.e. name and not something like @DEFAULT@)
548 551
549 def getPresenceStatus(self): 552 def getPresenceStatus(self):
550 debug ("Memory getPresenceStatus (%s)", self.presenceStatus) 553 debug ("Memory getPresenceStatus (%s)", self.presenceStatus)
551 return self.presenceStatus 554 return self.presenceStatus
552 555
553 def getParamA(self, name, category, attr="value"): 556 def getParamA(self, name, category, attr="value", profile_key="@DEFAULT@"):
554 return self.params.getParamA(name, category, attr) 557 return self.params.getParamA(name, category, attr, profile_key)
555 558
556 def getParams(self): 559 def getParams(self):
557 return self.params.getParams() 560 return self.params.getParams()
558 561
559 def getParamsForCategory(self, category): 562 def getParamsForCategory(self, category):