aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xmlGenerator
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2013-02-05 18:21:56 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:45 +0100
commit040a4df4fa42f5fcc808da2600ea7a37d0973bcb (patch)
treec42a9d28eb62817f2334b82c0098e5697227904f /tools/xmlGenerator
parent935f2afb8db14178f07660d12d982b5a734adfde (diff)
downloadexternal_parameter-framework-040a4df4fa42f5fcc808da2600ea7a37d0973bcb.zip
external_parameter-framework-040a4df4fa42f5fcc808da2600ea7a37d0973bcb.tar.gz
external_parameter-framework-040a4df4fa42f5fcc808da2600ea7a37d0973bcb.tar.bz2
PFW: Wrong rule order in generated xml file
BZ: 85553 The xml generator was inverting inherited rule, this patch corrects it. Rules are now ordered in the inheritance order. Rule inherited from high level element are now at the beginning of the rule list. It is only a cosmetic change a functional change. Change-Id: I5c718a93d24c64ec690377915a98404823cf8fba Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/90354 Reviewed-by: cactus <cactus@intel.com> Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'tools/xmlGenerator')
-rwxr-xr-xtools/xmlGenerator/PFWScriptGenerator.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/xmlGenerator/PFWScriptGenerator.py b/tools/xmlGenerator/PFWScriptGenerator.py
index bef427e..ff83ed3 100755
--- a/tools/xmlGenerator/PFWScriptGenerator.py
+++ b/tools/xmlGenerator/PFWScriptGenerator.py
@@ -231,20 +231,22 @@ class Element:
# If no exception was raised, add child to child list
if append :
- position = len(self.children)
+ self.children.append(child)
else :
- position = 0
-
- self.children.insert(position , child)
+ self.children.insert(0, child)
except ValueError:
# the child class is not in the white list
raise ChildNotPermitedError("", self, child)
def addChildren(self, children, append=True) :
- """add a list of child"""
- for child in children :
- self.addChild(child, append)
+ """Add a list of child"""
+ if append:
+ # Add children at the end of the child list
+ self.children.extend(children)
+ else:
+ # Add children at the begining of the child list
+ self.children = children + self.children
def childrenToXML(self, prefix=""):
"""return XML printed children"""
@@ -350,10 +352,10 @@ class ElementWithRuleInheritance(ElementWithInheritance):
# get context rules
contextRules = context.getRules()
- # adopt rules of the context
- self.addChildren(contextRules)
+ # adopt rules of the beginning of the context
+ self.addChildren(contextRules, append=False)
- # add previously extract rules the context
+ # add previously extract rules to the context
contextRules += childRules