Mercurial > libervia-backend
comparison tools/memory.py @ 197:ca1010f47002
core: fixed forgotten profile in paramUpdate signal
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Aug 2010 01:11:09 +0800 |
parents | 9ee4a1d0d7fb |
children | e178e8f6d13a |
comparison
equal
deleted
inserted
replaced
196:fc1654cf2a23 | 197:ca1010f47002 |
---|---|
357 categories.append(cat.getAttribute("name")) | 357 categories.append(cat.getAttribute("name")) |
358 return categories | 358 return categories |
359 | 359 |
360 def setParam(self, name, value, category, profile_key='@DEFAULT@'): | 360 def setParam(self, name, value, category, profile_key='@DEFAULT@'): |
361 """Set a parameter, return None if the parameter is not in param xml""" | 361 """Set a parameter, return None if the parameter is not in param xml""" |
362 profile = self.getProfileName(profile_key) | |
363 if not profile: | |
364 error(_('Trying to set parameter for an unknown profile')) | |
365 return #TODO: throw an error | |
362 | 366 |
363 node = self.__getParamNode(name, category, '@ALL@') | 367 node = self.__getParamNode(name, category, '@ALL@') |
364 if not node: | 368 if not node: |
365 error(_('Requesting an unknown parameter (%(category)s/%(name)s)') % {'category':category, 'name':name}) | 369 error(_('Requesting an unknown parameter (%(category)s/%(name)s)') % {'category':category, 'name':name}) |
366 return | 370 return |
367 | 371 |
368 if node[0] == 'general': | 372 if node[0] == 'general': |
369 self.params_gen[(category, name)] = value | 373 self.params_gen[(category, name)] = value |
370 self.host.bridge.paramUpdate(name, value, category) #TODO: add profile in signal | 374 self.host.bridge.paramUpdate(name, value, category, profile) #TODO: add profile in signal |
371 return | 375 return |
372 | 376 |
373 assert (node[0] == 'individual') | 377 assert (node[0] == 'individual') |
374 | |
375 profile = self.getProfileName(profile_key) | |
376 if not profile: | |
377 error(_('Trying to set parameter for an unknown profile')) | |
378 return #TODO: throw an error | |
379 | 378 |
380 type = node[1].getAttribute("type") | 379 type = node[1].getAttribute("type") |
381 if type=="button": | 380 if type=="button": |
382 print "clique",node.toxml() | 381 print "clique",node.toxml() |
383 else: | 382 else: |