comparison tools/memory.py @ 62:93cb45a7420f

SàT multi-profile: connection using profiles - /!\ plugins are temporarly deactivated
author Goffi <goffi@goffi.org>
date Fri, 29 Jan 2010 13:55:41 +1100
parents 58d49fc19639
children 0db25931b60d
comparison
equal deleted inserted replaced
61:58d49fc19639 62:93cb45a7420f
362 self.presenceStatus={} 362 self.presenceStatus={}
363 self.subscriptions={} 363 self.subscriptions={}
364 self.params=Param(host) 364 self.params=Param(host)
365 self.history={} #used to store chat history (key: short jid) 365 self.history={} #used to store chat history (key: short jid)
366 self.private={} #used to store private value 366 self.private={} #used to store private value
367 self.disco={} #XXX: maybe best in a separate class
368 self.features={}
369 host.set_const('savefile_history', SAVEFILE_HISTORY) 367 host.set_const('savefile_history', SAVEFILE_HISTORY)
370 host.set_const('savefile_private', SAVEFILE_PRIVATE) 368 host.set_const('savefile_private', SAVEFILE_PRIVATE)
371 self.load() 369 self.load()
372 370
373 def load(self): 371 def load(self):
439 pickle.dump(self.private, private_pickle) 437 pickle.dump(self.private, private_pickle)
440 debug("private values saved") 438 debug("private values saved")
441 439
442 def getProfilesList(self): 440 def getProfilesList(self):
443 return self.params.getProfilesList() 441 return self.params.getProfilesList()
442
443
444 def getProfileName(self, profile_key):
445 """Return name of profile from keyword
446 @param profile_key: can be the profile name or a keywork (like @DEFAULT@)
447 @return: profile name or None if it doesn't exist"""
448 return self.params.getProfileName(profile_key)
444 449
445 def createProfile(self, name, default=False): 450 def createProfile(self, name, default=False):
446 """Create a new profile 451 """Create a new profile
447 @param name: Profile name 452 @param name: Profile name
448 @param default: True if default profile (replace previous default) 453 @param default: True if default profile (replace previous default)