Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def rebuild_bbscript(sourceFilename,outFilename):
global output
sourceAST = astor.parsefile(sourceFilename)
f = open(outFilename+".txt","w")
f.write(astor.dump(sourceAST))
f.close()
output = open(outFilename,"wb")
Rebuilder().visit(sourceAST)
output.close()
#output = open(outFilename,"rb")
def rebuild_bbscript(sourceFilename,outFilename):
global output
sourceAST = astor.parsefile(sourceFilename)
if(os.path.isfile(sourceFilename+".txt")):
os.remove(sourceFilename+".txt")
f = open(sourceFilename+".txt","w")
f.write(astor.dump(sourceAST))
f.close()
output = open(outFilename,"wb")
Rebuilder().visit(sourceAST)
output.close()
def rebuild_dbzfscript(sourceFilename,outFilename):
global output
sourceAST = astor.parsefile(sourceFilename)
if(os.path.isfile(sourceFilename+".txt")):
os.remove(sourceFilename+".txt")
f = open(sourceFilename+".txt","w")
f.write(astor.dump(sourceAST))
f.close()
output = open(outFilename,"wb")
Rebuilder().visit(sourceAST)
output.close()
def rebuild_bbscript(sourceFilename,outFilename):
global output
sourceAST = astor.parsefile(sourceFilename)
output = open(outFilename,"wb")
Rebuilder().visit(sourceAST)
output.close()
#output = open(outFilename,"rb")
def match(self, selector, filename):
module = astor.parsefile(filename)
for match in super(ASTMatchEngine, self).match(selector, module.body):
lineno = match.lineno
if isinstance(match, (ast.ClassDef, ast.FunctionDef)):
for d in match.decorator_list:
lineno += 1
yield match, lineno