def writeConnectionPoolADB( runtime ): outfileName = paths.getPaths().srcDir + 'connection_pool.adb' template = Template( file=templatesPath()+"connection_pool.adb.tmpl" ) template.date = datetime.datetime.now() template.customImports = readLinesBetween( outfileName, ".*CUSTOM.*IMPORTS.*START", ".*CUSTOM.*IMPORT.*END" ) template.customTypes = readLinesBetween( outfileName, ".*CUSTOM.*TYPES.*START", ".*CUSTOM.*TYPES.*END" ) template.customProcs = readLinesBetween( outfileName, ".*CUSTOM.*PROCS.*START", ".*CUSTOM.*PROCS.*END" ) outfile = file( outfileName, 'w' ); outfile.write( str(template) ) outfile.close()
def makeDriverCommons(): """ Write versions of support files db_commons-odbc to src/ We just add some headers to each; otherwise they're uncustomised. """ targets = [ 'db_commons-odbc' ] exts = [ 'adb', 'ads' ] for target in targets: for ext in exts: outfileName = paths.getPaths().srcDir + target+"."+ext template = Template( file=templatesPath()+target+"."+ext+"."+"tmpl" ) template.customImports = readLinesBetween( outfileName, ".*CUSTOM.*IMPORTS.*START", ".*CUSTOM.*IMPORT.*END" ) template.customTypes = readLinesBetween( outfileName, ".*CUSTOM.*TYPES.*START", ".*CUSTOM.*TYPES.*END" ) template.customProcs = readLinesBetween( outfileName, ".*CUSTOM.*PROCS.*START", ".*CUSTOM.*PROCS.*END" ) template.date = datetime.datetime.now() outfile = file( outfileName, 'w' ); outfile.write( str(template) ) outfile.close()
def makeDriverCommons(): """ """ targets = [ 'db_commons-psql' ] exts = [ 'adb', 'ads' ] for target in targets: for ext in exts: outfileName = paths.getPaths().srcDir + target+"."+ext template = Template( file=templatesPath()+target+"."+ext+"."+"tmpl" ) template.customImports = readLinesBetween( outfileName, ".*CUSTOM.*IMPORTS.*START", ".*CUSTOM.*IMPORT.*END" ) template.customTypes = readLinesBetween( outfileName, ".*CUSTOM.*TYPES.*START", ".*CUSTOM.*TYPES.*END" ) template.customProcs = readLinesBetween( outfileName, ".*CUSTOM.*PROCS.*START", ".*CUSTOM.*PROCS.*END" ) template.date = datetime.datetime.now() #outfile = file( outfileName, 'w' ); #outfile.write( str(template) ) #outfile.close() conditionalWrite( outfileName, str( template )) return