def doCreate(self, strDbms, strFilename): print '\tpython xml2ddl.py --dbms %s %s' % (strDbms, strFilename) print cd = xml2ddl.Xml2Ddl() cd.setDbms(strDbms) xml = xml2ddl.readMergeDict(strFilename) results = cd.createTables(xml) for result in results: print "\t%s;" % (result[1].replace('\t', '\t\t')) print
def writeHTML(): #Generate a html file from the configuration xml xml2html = Xml2Html() strFilename = sourcePath xml = readMergeDict(strFilename) lines = xml2html.outputHtml(xml) strOutfile = destHtml of = open(strOutfile, "w") for line in lines: of.write("%s\n" % (line)) of.close()
def writeSQLFile(dropTable=False): configdoc = Xml2Ddl() configdoc.setDbms("postgres") configdoc.params['drop-tables'] = dropTable #strFilename = path xml = readMergeDict(sourcePath) results = configdoc.createTables(xml) fileN = open(destPath, "w") for result in results: fileN.write(result[1]) fileN.write("\n") fileN.close()
def writeXml(dropTable=True): cd = Xml2Ddl() cd.setDbms("postgres") cd.params['drop-tables'] = dropTable #strFilename = path xml = readMergeDict(sourcePath) results = cd.createTables(xml) fileN=open(destPath,"w") for result in results: fileN.write(result[1]) fileN.write("\n") fileN.close()