Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- for file in os.chdir(path):
- if file.endswith(".as"):
- fileInput = open(file,'r') #open the file as read
- fileOutput = open(file,'w') #open the file as write
- for line in fileOutput:
- fileOutput.write(str.replace(":Bool", ":Boolean"))
- fileOutput.write(str.replace(":Number", ":Float"))
- fileOutput.write(str.replace(":int", ":Int"))
- fileOutput.write(str.replace(":uint", ":UInt"))
- fileOutput.write(str.replace(":object", ":Dynamic"))
- fileOutput.write(str.replace("package {", "package;"))
- fileOutput.write(str.replace("public class", "class"))
- fileOutput.write(str.replace(" const ", " inline "))
- fileOutput.write(str.replace("new Date().getTime()", "Date.now().getTime()"))
- fileOutput.write(str.replace("JSONManager.encode(", "Json.stringify("))
- fileOutput.write(str.replace("JSONManager.decode(", "Json.parse("))
- fileInput.close()
- fileOutput.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement