def initializeDB(self, metadata, engine): taskInfos = TaskInfo.dbDesign(metadata) inputFiles = InputFile.dbDesign(metadata) outputFiles = OutputFile.dbDesign(metadata) arguments = Argument.dbDesign(metadata) gridTasks = GridTask.dbDesign(metadata) hosts = Host.dbDesign(metadata) taskGroups = TaskGroup.dbDesign(metadata) metadata.create_all(engine)
mySession = mySessionClass() metadata = MetaData() taskInfos = TaskInfo.dbDesign(metadata) inputFiles = InputFile.dbDesign(metadata) outputFiles = OutputFile.dbDesign(metadata) arguments = Argument.dbDesign(metadata) gridTasks = GridTask.dbDesign(metadata) taskGroups = TaskGroup.dbDesign(metadata) metadata.create_all(engine) #create task group taskGroup = TaskGroup.TaskGroup(indexFile, postProcessScript) mySession.add(taskGroup) mySession.commit() print("LOADING TASK GROUP: " + indexFile) for xmlFile in open(indexFile, 'r'): xmlFile = xmlFile.strip() auxTask = GridTask.GridTask() auxTask.fromXML(taskGroup.id,xmlFile) mySession.add(auxTask)