diff options
author | Fahim | 2015-08-18 21:23:43 +0530 |
---|---|---|
committer | Fahim | 2015-08-18 21:23:43 +0530 |
commit | 829df641dd9c13928b73e45ab4e11229b5336fd8 (patch) | |
tree | ce46e8ca7d20f5a50d351057acf0de67eb329025 /src/modelEditor/ModelEditor.py | |
parent | 3be4e7e563ae0b71904cb12899ecb7b8fed78bdc (diff) | |
download | eSim-829df641dd9c13928b73e45ab4e11229b5336fd8.tar.gz eSim-829df641dd9c13928b73e45ab4e11229b5336fd8.tar.bz2 eSim-829df641dd9c13928b73e45ab4e11229b5336fd8.zip |
Subject: Model Editor Bug fixing
Description: Modify model editor to save xml file for device library
Diffstat (limited to 'src/modelEditor/ModelEditor.py')
-rw-r--r-- | src/modelEditor/ModelEditor.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 2cc9761c..2015798d 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -422,14 +422,19 @@ class ModelEditorclass(QtGui.QWidget): libfile.write('+ ' + tags + '=' + text +'\n') libfile.write(')') libfile.close() - for params in self.tree.findall('param'): - self.root.remove(params) - param = ET.SubElement(self.root,'param') + + root = ET.Element("library") + ET.SubElement(root, "model_name").text = self.model_name + ET.SubElement(root, "ref_model").text = self.ref_model + param = ET.SubElement(root, "param") for tags, text in self.modeldict.items(): ET.SubElement(param, tags).text = text - self.tree.write(editfile) - self.obj_appconfig.print_info('Updated library ' + libpath) + tree = ET.ElementTree(root) + + tree.write(os.path.join(xmlpath,filename +".xml")) + self.obj_appconfig.print_info('Updated library ' + libpath) + def removeparameter(self): self.savebtn.setDisabled(False) index = self.modeltable.currentIndex() |