Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import os
  2. for file in os.chdir(path):
  3. if file.endswith(".as"):
  4. fileInput = open(file,'r') #open the file as read
  5. fileOutput = open(file,'w') #open the file as write
  6. for line in fileOutput:
  7. fileOutput.write(str.replace(":Bool", ":Boolean"))
  8. fileOutput.write(str.replace(":Number", ":Float"))
  9. fileOutput.write(str.replace(":int", ":Int"))
  10. fileOutput.write(str.replace(":uint", ":UInt"))
  11. fileOutput.write(str.replace(":object", ":Dynamic"))
  12. fileOutput.write(str.replace("package {", "package;"))
  13. fileOutput.write(str.replace("public class", "class"))
  14. fileOutput.write(str.replace(" const ", " inline "))
  15. fileOutput.write(str.replace("new Date().getTime()", "Date.now().getTime()"))
  16. fileOutput.write(str.replace("JSONManager.encode(", "Json.stringify("))
  17. fileOutput.write(str.replace("JSONManager.decode(", "Json.parse("))
  18. fileInput.close()
  19. fileOutput.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement