Edit project.xml programmatically

svn path=/workspaces/kadam/; revision=15657
This commit is contained in:
Adam Kornafeld 2008-07-22 20:57:25 +00:00
parent 1d3349b4b0
commit a0ff4d5276
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ class ProjectFile(XMLConfig):
default_project_file = self
def _get_elements(self):
self.xml_boinc = get_element(self.xml, 'boinc', optional=False)
self.elements = ConfigDictList(self.xml_boinc)
self.add_objects_and_args = []
for node in self.xml_boinc.childNodes:
add_object = add_objects.get(node.nodeName)
@ -38,7 +39,7 @@ class ProjectFile(XMLConfig):
raise SystemExit("Error in %s: No such object '%s' to add." %(self.filename,node.nodeName))
self.add_objects_and_args.append((add_object, get_elements_as_dict(node)))
def _set_elements(self):
assert(0) # TODO (maybe)
self.elements.save()
def commit_all(self):
'''Commits all new data to the BOINC project database.'''
for add_object, untranslated_args_dict in self.add_objects_and_args: