text: import re
  text = open('src/post.js', 'r').read()
  methods = []
  for line in re.search(r"BEGIN API SECTION(.*)END API SECTION", text, re.DOTALL).group(1).split("\n"):
  	m = re.match("API\\.([\\w]+) ", line.strip())
  	if m == None:
  		continue
  	name = m.group(1)
  	methods.append("OCRAD." + name + (" " * (30 - len(name))) + " = fwrap('" + name + "');")
  
  repl = "BEGIN AUTOGENERATED //\n" + "\n".join(methods) + "\n// END AUTOGENERATED"
  with open('src/post.js', 'w') as w:
  	w.write(re.sub("BEGIN AUTOGENERATED(.*)END AUTOGENERATED", repl, text, flags=re.DOTALL));
  