Mercurial > libervia-backend
comparison src/tools/memory.py @ 396:cecd22241d56
memory: avoid duplicate in getParamsCategories
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Oct 2011 23:43:06 +0200 |
parents | 79fe50fc8edc |
children | cb0285372818 |
comparison
equal
deleted
inserted
replaced
395:79fe50fc8edc | 396:cecd22241d56 |
---|---|
374 | 374 |
375 def getParamsCategories(self): | 375 def getParamsCategories(self): |
376 """return the categories availables""" | 376 """return the categories availables""" |
377 categories=[] | 377 categories=[] |
378 for cat in self.dom.getElementsByTagName("category"): | 378 for cat in self.dom.getElementsByTagName("category"): |
379 categories.append(cat.getAttribute("name")) | 379 name = cat.getAttribute("name") |
380 if name not in categories: | |
381 categories.append(cat.getAttribute("name")) | |
380 return categories | 382 return categories |
381 | 383 |
382 def setParam(self, name, value, category, profile_key='@NONE@'): | 384 def setParam(self, name, value, category, profile_key='@NONE@'): |
383 """Set a parameter, return None if the parameter is not in param xml""" | 385 """Set a parameter, return None if the parameter is not in param xml""" |
384 if profile_key!="@NONE@": | 386 if profile_key!="@NONE@": |