Example #1
0
 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
Example #2
0
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()
Example #3
0
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() 
Example #4
0
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()
Example #5
0
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()
Example #6
0
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()