import os import sys NSPLIT=10 def main(argv): input_dir="." output_dir="." name=sys.argv[1] if len(argv)>2: input_dir=argv[2] if len(argv)>3: output_dir=argv[3] print("name:",name) print("input_dir:",input_dir) print("output_dir:",output_dir) in_h=os.path.join(input_dir,name + ".pb.h") in_cpp=os.path.join(input_dir,name + ".pb.cc") out_h=os.path.join(output_dir,name + ".pb.main.h") out_cpp_template=os.path.join(output_dir,name + ".pb.I") with open(out_h,"w") as out_file: with open(in_h,"r") as in_file: for line in in_file: line = line.replace("inline void RegisterArenaDtor","void RegisterArenaDtor") out_file.write(line) for i in range(0,2 + NSPLIT): with open(out_cpp_template.replace("I","code" + str(i) + ".cc" if i