X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=scripts%2Fextgen.py;h=f349d5251473a8f147d3af9edf082a636e89a6fd;hp=2c515f22ecee971f234796924428376d58f80c8f;hb=4acc43935d3b19bae688e89ed42119e326a26f2d;hpb=e87e7a542c2b9fcde1676ba17387fcfb5180f196 diff --git a/scripts/extgen.py b/scripts/extgen.py index 2c515f22..f349d525 100755 --- a/scripts/extgen.py +++ b/scripts/extgen.py @@ -2,23 +2,23 @@ import sys -ext=sys.argv[1] +ext = sys.argv[1] -funcs=[] -cur_func=None +funcs = [] +cur_func = None for line in file("gl.spec"): if line[0]=='#' or line.find(':')>=0: continue elif line[0]=='\t' and cur_func: - parts=line.split() + parts = line.split() if parts[0]=="category" and parts[1]==ext: funcs.append(cur_func) else: - paren=line.find('(') + paren = line.find('(') if paren>0: - cur_func=line[:paren] + cur_func = line[:paren] -out=file(ext.lower()+".h", "w") +out = file(ext.lower()+".h", "w") out.write("#ifndef MSP_GL_%s_\n"%ext.upper()) out.write("#define MSP_GL_%s_\n"%ext.upper()) @@ -43,7 +43,7 @@ out.write(""" #endif """) -out=file(ext.lower()+".cpp", "w") +out = file(ext.lower()+".cpp", "w") out.write("#include \"extension.h\"\n") out.write("#include \"%s.h\"\n"%ext.lower()) @@ -54,11 +54,11 @@ namespace GL { """) for f in funcs: - out.write("PFNGL%sPROC gl%s=0;\n"%(f.upper(), f)) + out.write("PFNGL%sPROC gl%s = 0;\n"%(f.upper(), f)) out.write("\nvoid init_%s()\n{\n"%ext.lower()) for f in funcs: - out.write("\tgl%s=reinterpret_cast(get_proc_address(\"gl%s\"));\n"%(f, f.upper(), f)) + out.write("\tgl%s = reinterpret_cast(get_proc_address(\"gl%s\"));\n"%(f, f.upper(), f)) out.write("}\n") out.write("""