def extractJsFromHtmlDir(inputdir, outputdir): if not utils.checkdir(inputdir, outputdir): return infiles = utils.lsresult(inputdir) for infile in infiles: outfile = outputdir + '/' + infile infile = inputdir + infile if utils.checkfile(infile, outfile): extractJsFromHtml(infile, outfile)
def jsdeobfuscatedir(inputdir, outputdir): if os.path.exists(outputdir): if os.path.isfile(outputdir): print 'The out dir is conflict with other filename' return shutil.rmtree(outputdir) os.makedirs(outputdir) # if not utils.checkdir(inputdir, outputdir): # return infiles = utils.lsresult(inputdir) for infile in infiles: outfile = outputdir + '/' + infile infile = inputdir + '/' + infile if utils.checkfile(infile, outfile): jsdeobfuscatefile(infile, outfile)