def make_sample_app_inp(arch_dir): "makes sample from app ker inputs" log.info("makes sample from app ker inputs and removing XSEDE specific runScript") dir=os.path.join(arch_dir,"cfg","apps") for f in os.listdir(dir): if f=="test.app.inp.py":continue if fnmatch.fnmatch(f,"*.app.inp.py"): newname=f.replace(".app.inp.py",".example.inp.py") shutil.copy(os.path.join(dir,f),os.path.join(dir,newname)) #new remove all runScript fin=open(os.path.join(dir,newname),"r") lines=fin.readlines() fin.close() fout=open(os.path.join(dir,f),"w") for l in lines: m=re.match("runScript\[\s*['\"](.*)['\"]\s*\]\s*=",l) if m: #print "="*80 if m.groups()[0]!='default': break fout.write(l) fout.close()
def make_sample_app_inp(arch_dir): "makes sample from app ker inputs" log.info( "makes sample from app ker inputs and removing XSEDE specific runScript" ) dir = os.path.join(arch_dir, "cfg", "apps") for f in os.listdir(dir): if f == "test.app.inp.py": continue if fnmatch.fnmatch(f, "*.app.inp.py"): newname = f.replace(".app.inp.py", ".example.inp.py") shutil.copy(os.path.join(dir, f), os.path.join(dir, newname)) #new remove all runScript fin = open(os.path.join(dir, newname), "r") lines = fin.readlines() fin.close() fout = open(os.path.join(dir, f), "w") for l in lines: m = re.match("runScript\[\s*['\"](.*)['\"]\s*\]\s*=", l) if m: #print "="*80 if m.groups()[0] != 'default': break fout.write(l) fout.close()
def package(archname): arch_dir=os.path.join(build_dir,archname) src_dir=cur_dir arch_file=arch_dir+"-"+akrrversion.akrrversion+".tar.gz" log.info("Archiving directory: {}",arch_dir) if not os.path.isdir(build_dir): os.mkdir(build_dir) if os.path.exists(arch_file): os.remove(arch_file) if os.path.isdir(arch_dir): print "remove packaging directory first: rm",arch_dir shutil.rmtree(arch_dir) #exit() os.mkdir(arch_dir) copy_to_arch(arch_dir) #now compressw log.info("Compressing!") tar = tarfile.open(arch_file, "w:gz") tar.add(arch_dir,arcname=archname) tar.close() log.info("Packaging complete! "+arch_file)
def package(archname): arch_dir = os.path.join(build_dir, archname) src_dir = cur_dir arch_file = arch_dir + "-" + akrrversion.akrrversion + ".tar.gz" log.info("Archiving directory: {}", arch_dir) if not os.path.isdir(build_dir): os.mkdir(build_dir) if os.path.exists(arch_file): os.remove(arch_file) if os.path.isdir(arch_dir): print "remove packaging directory first: rm", arch_dir shutil.rmtree(arch_dir) #exit() os.mkdir(arch_dir) copy_to_arch(arch_dir) #now compressw log.info("Compressing!") tar = tarfile.open(arch_file, "w:gz") tar.add(arch_dir, arcname=archname) tar.close() log.info("Packaging complete! " + arch_file)