comparison tools/memory.py @ 182:556c2bd7c344

Primitivus now implement showDialog + new "newAlert" bridge method to show a dialog from core
author Goffi <goffi@goffi.org>
date Wed, 18 Aug 2010 12:45:48 +0800
parents b318d2b58887
children 9ee4a1d0d7fb
comparison
equal deleted inserted replaced
181:a566f654929e 182:556c2bd7c344
107 107
108 def __init__(self, host): 108 def __init__(self, host):
109 debug("Parameters init") 109 debug("Parameters init")
110 self.host = host 110 self.host = host
111 self.default_profile = None 111 self.default_profile = None
112 self.params = {'goffi':{}} #gof: 112 self.params = {}
113 self.params_gen = {} 113 self.params_gen = {}
114 host.set_const('savefile_param_xml', SAVEFILE_PARAM_XML) 114 host.set_const('savefile_param_xml', SAVEFILE_PARAM_XML)
115 host.set_const('savefile_param_data', SAVEFILE_PARAM_DATA) 115 host.set_const('savefile_param_data', SAVEFILE_PARAM_DATA)
116 host.registerGeneralCB("registerNewAccount", host.registerNewAccountCB) 116 host.registerGeneralCB("registerNewAccount", host.registerNewAccountCB)
117 117
148 default = self.host.memory.getPrivate('Profile_default') 148 default = self.host.memory.getPrivate('Profile_default')
149 if not default or not default in self.params: 149 if not default or not default in self.params:
150 info(_('No default profile, returning first one')) #TODO: manage real default profile 150 info(_('No default profile, returning first one')) #TODO: manage real default profile
151 default = self.params.keys()[0] 151 default = self.params.keys()[0]
152 self.host.memory.setPrivate('Profile_default', default) 152 self.host.memory.setPrivate('Profile_default', default)
153 return default #FIXME: gof: temporary, must use real default value, and fallback to first one if it doesn't exists 153 return default #FIXME: temporary, must use real default value, and fallback to first one if it doesn't exists
154 if not self.params.has_key(profile_key): 154 if not self.params.has_key(profile_key):
155 info (_('Trying to access an unknown profile')) 155 info (_('Trying to access an unknown profile'))
156 return "" 156 return ""
157 return profile_key 157 return profile_key
158 158