From 71522733d97a5d2ff704760f9f4b68e6b3a6d3c2 Mon Sep 17 00:00:00 2001 From: asv Date: Mon, 6 Jun 2005 12:15:46 +0000 Subject: [PATCH] Fix for bug PAL 8922: component name, given by user in "Catalog Generator" dialog box was NOT properly handled (was not used) in IDLparser.py script. Another fix: if user name is not set in "Catalog Generator", but component name is set - then component name is used instead of component user name. --- src/ModuleGenerator/IDLparser.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ModuleGenerator/IDLparser.py b/src/ModuleGenerator/IDLparser.py index a653da09e..77b4b037e 100644 --- a/src/ModuleGenerator/IDLparser.py +++ b/src/ModuleGenerator/IDLparser.py @@ -49,7 +49,7 @@ nb_components = 0 # catalog=/tmp/myxml.xml #-------------------------------------------------- def getParamValue( param_name, default_value, args ): - pattern=param_name+"=" + pattern="^"+param_name+"=" res = default_value #initial value for opt in args: @@ -410,12 +410,20 @@ class Component(Tree): Tree.__init__(self, 'component', key=name) if name is None: return - self.addNamedChild('component-name', name) +# ASV : fix for bug PAL8922 (Component name indicated by user in GUI is not taken into account + if common_data["COMP_NAME"] != '': + self.addNamedChild('component-name', common_data["COMP_NAME"]) + else: + self.addNamedChild('component-name', name) +# ASV : if user name is NOT set, then use component-name instead. Else - default. if common_data["COMP_UNAME"] != '': self.addNamedChild('component-username', common_data["COMP_UNAME"]) else: - self.addNamedChild('component-username', name) + if common_data["COMP_NAME"] != '': + self.addNamedChild('component-username', common_data["COMP_NAME"] ) + else: + self.addNamedChild('component-username', name) self.addNamedChild('component-type', common_data["COMP_TYPE"]) self.addNamedChild('component-author', common_data["AUTHOR"]) @@ -673,7 +681,7 @@ def run(tree, args): common_data["ICON"] = getParamValue("icon", "", args) common_data["AUTHOR"] = getParamValue("author", os.getenv("USER"), args) common_data["VERSION"] = getParamValue("version", "1", args) - common_data["COMP_NAME"] = getParamValue("name", "", args) + common_data["COMP_NAME"] = getParamValue("name", "", args) common_data["COMP_UNAME"] = getParamValue("username", "", args) common_data["COMP_TYPE"] = getParamValue("type", "OTHER", args) common_data["COMP_MULT"] = getParamValue("multistudy", "1", args) -- 2.39.2