def export_machine_database(self, exportdir): element = MachineDatabaseElement(self.conn) exportdir = path(exportdir) makepaths(exportdir) filename = exportdir / 'machine_database.xml' xmlfile = file(filename, 'w') xmlfile.write(element.toprettyxml()) xmlfile.close() machine_dir = exportdir / 'machines' self.export_all_machines(machine_dir)
def export_machine_database(self, path): me = MachineDatabaseElement(self.conn) mdfile = file(join(path, 'machine_database.xml'), 'w') mtypepath = join(path, 'machine_types') mdfile.write(me.toprettyxml()) mdfile.close() for mtype in me.mtypes.machine_types: name = mtype.getAttribute('name') self.mtype.set_machine_type(name) self.mtype.export_machine_type(name, mtypepath)
def export_machine_database(self, path): me = MachineDatabaseElement(self.conn) mdfile = file(join(path, 'machine_database.xml'), 'w') mtypepath = join(path, 'machine_types') mdfile.write(me.toprettyxml()) mdfile.close() for mtype in me.mtypes.machine_types: name = mtype.getAttribute('name') self.mtype.set_machine_type(name) self.mtype.export_machine_type(name, mtypepath)