#store the merged sql files in new dir from datetime import date
sqlSortDirDst =date.today().strftime("%Y%m%d")+"VerSubmitSqls"
sqlSortDirDstPath = os.path.join( orginSqldir,sqlSortDirDst )
#
if os.path.exists( sqlSortDirDstPath ):
shutil.rmtree( sqlSortDirDstPath )
os.mkdir( sqlSortDirDstPath )
#walk through dic_all for k, v in dic_all.iteritems():
if len( v )== 0:
continue
k_sql = k +'.sql' ##suffix
abs_dst_db_fpath = os.path.join(sqlSortDirDstPath , k_sql )
# print abs_dst_db_fpath
fh_dst = open( abs_dst_db_fpath,'w')
v.sort() for iv in v:
cpsql2dbfile( iv, fh_dst )
fh_dst.flush()
fh_dst.close()