mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 21:21:10 +00:00
style: Start applying PEP8 to Python files, indentation issues
Done with `autopep8 --select=E1`, fixes: - E101 - Reindent all lines. - E112 - Fix under-indented comments. - E113 - Fix over-indented comments. - E115 - Fix under-indented comments. - E116 - Fix over-indented comments. - E121 - Fix a badly indented line. - E122 - Fix a badly indented line. - E123 - Fix a badly indented line. - E124 - Fix a badly indented line. - E125 - Fix indentation undistinguish from the next logical line. - E126 - Fix a badly indented line. - E127 - Fix a badly indented line. - E128 - Fix a badly indented line. - E129 - Fix a badly indented line.
This commit is contained in:
parent
681575fa71
commit
97c8508f5e
88 changed files with 6291 additions and 6291 deletions
|
|
@ -2,8 +2,8 @@
|
|||
import sys
|
||||
|
||||
if (len(sys.argv)<2):
|
||||
print("usage: make_glwrapper.py <headers>")
|
||||
sys.exit(255)
|
||||
print("usage: make_glwrapper.py <headers>")
|
||||
sys.exit(255)
|
||||
|
||||
|
||||
functions=[]
|
||||
|
|
@ -17,16 +17,16 @@ READ_CONSTANTS=2
|
|||
read_what=READ_TYPES
|
||||
|
||||
for x in (range(len(sys.argv)-1)):
|
||||
f=open(sys.argv[x+1],"r")
|
||||
f=open(sys.argv[x+1],"r")
|
||||
|
||||
while(True):
|
||||
while(True):
|
||||
|
||||
line=f.readline()
|
||||
if (line==""):
|
||||
break
|
||||
line=f.readline()
|
||||
if (line==""):
|
||||
break
|
||||
|
||||
line=line.replace("\n","").strip()
|
||||
"""
|
||||
line=line.replace("\n","").strip()
|
||||
"""
|
||||
if (line.find("[types]")!=-1):
|
||||
read_what=READ_TYPES
|
||||
continue
|
||||
|
|
@ -38,53 +38,53 @@ for x in (range(len(sys.argv)-1)):
|
|||
continue
|
||||
"""
|
||||
|
||||
if (line.find("#define")!=-1):
|
||||
if (line.find("0x")==-1 and line.find("GL_VERSION")==-1):
|
||||
continue
|
||||
constants.append(line)
|
||||
elif (line.find("typedef")!=-1):
|
||||
if (line.find("(")!=-1 or line.find(")")!=-1 or line.find("ARB")!=-1 or line.find("EXT")!=-1 or line.find("GL")==-1):
|
||||
continue
|
||||
types.append(line)
|
||||
elif (line.find("APIENTRY")!=-1 and line.find("GLAPI")!=-1):
|
||||
if (line.find("#define")!=-1):
|
||||
if (line.find("0x")==-1 and line.find("GL_VERSION")==-1):
|
||||
continue
|
||||
constants.append(line)
|
||||
elif (line.find("typedef")!=-1):
|
||||
if (line.find("(")!=-1 or line.find(")")!=-1 or line.find("ARB")!=-1 or line.find("EXT")!=-1 or line.find("GL")==-1):
|
||||
continue
|
||||
types.append(line)
|
||||
elif (line.find("APIENTRY")!=-1 and line.find("GLAPI")!=-1):
|
||||
|
||||
if (line.find("ARB")!=-1 or line.find("EXT")!=-1 or line.find("NV")!=-1):
|
||||
continue
|
||||
if (line.find("ARB")!=-1 or line.find("EXT")!=-1 or line.find("NV")!=-1):
|
||||
continue
|
||||
|
||||
line=line.replace("APIENTRY","")
|
||||
line=line.replace("GLAPI","")
|
||||
line=line.replace("APIENTRY","")
|
||||
line=line.replace("GLAPI","")
|
||||
|
||||
glpos=line.find(" gl")
|
||||
if (glpos==-1):
|
||||
glpos=line.find(" gl")
|
||||
if (glpos==-1):
|
||||
|
||||
glpos=line.find("\tgl")
|
||||
if (glpos==-1):
|
||||
continue
|
||||
glpos=line.find("\tgl")
|
||||
if (glpos==-1):
|
||||
continue
|
||||
|
||||
ret=line[:glpos].strip();
|
||||
ret=line[:glpos].strip();
|
||||
|
||||
line=line[glpos:].strip()
|
||||
namepos=line.find("(")
|
||||
line=line[glpos:].strip()
|
||||
namepos=line.find("(")
|
||||
|
||||
if (namepos==-1):
|
||||
continue
|
||||
if (namepos==-1):
|
||||
continue
|
||||
|
||||
name=line[:namepos].strip()
|
||||
line=line[namepos:]
|
||||
name=line[:namepos].strip()
|
||||
line=line[namepos:]
|
||||
|
||||
argpos=line.rfind(")")
|
||||
if (argpos==-1):
|
||||
continue
|
||||
argpos=line.rfind(")")
|
||||
if (argpos==-1):
|
||||
continue
|
||||
|
||||
args=line[1:argpos]
|
||||
args=line[1:argpos]
|
||||
|
||||
funcdata={}
|
||||
funcdata["ret"]=ret
|
||||
funcdata["name"]=name
|
||||
funcdata["args"]=args
|
||||
funcdata={}
|
||||
funcdata["ret"]=ret
|
||||
funcdata["name"]=name
|
||||
funcdata["args"]=args
|
||||
|
||||
functions.append(funcdata)
|
||||
print(funcdata)
|
||||
functions.append(funcdata)
|
||||
print(funcdata)
|
||||
|
||||
|
||||
|
||||
|
|
@ -137,18 +137,18 @@ f.write("#else\n");
|
|||
f.write("#define GLWRP_APIENTRY \n")
|
||||
f.write("#endif\n\n");
|
||||
for x in types:
|
||||
f.write(x+"\n")
|
||||
f.write(x+"\n")
|
||||
|
||||
f.write("\n\n")
|
||||
|
||||
for x in constants:
|
||||
f.write(x+"\n")
|
||||
f.write(x+"\n")
|
||||
|
||||
f.write("\n\n")
|
||||
|
||||
for x in functions:
|
||||
f.write("extern "+x["ret"]+" GLWRP_APIENTRY (*__wrapper_"+x["name"]+")("+x["args"]+");\n")
|
||||
f.write("#define "+x["name"]+" __wrapper_"+x["name"]+"\n")
|
||||
f.write("extern "+x["ret"]+" GLWRP_APIENTRY (*__wrapper_"+x["name"]+")("+x["args"]+");\n")
|
||||
f.write("#define "+x["name"]+" __wrapper_"+x["name"]+"\n")
|
||||
|
||||
f.write("\n\n")
|
||||
f.write("typedef void (*GLWrapperFuncPtr)(void);\n\n");
|
||||
|
|
@ -165,14 +165,14 @@ f.write("#include \"glwrapper.h\"\n")
|
|||
f.write("\n\n")
|
||||
|
||||
for x in functions:
|
||||
f.write(x["ret"]+" GLWRP_APIENTRY (*__wrapper_"+x["name"]+")("+x["args"]+")=NULL;\n")
|
||||
f.write(x["ret"]+" GLWRP_APIENTRY (*__wrapper_"+x["name"]+")("+x["args"]+")=NULL;\n")
|
||||
|
||||
f.write("\n\n")
|
||||
f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) ) {\n")
|
||||
f.write("\n")
|
||||
|
||||
for x in functions:
|
||||
f.write("\t__wrapper_"+x["name"]+"=("+x["ret"]+" GLWRP_APIENTRY (*)("+x["args"]+"))wrapperFunc(\""+x["name"]+"\");\n")
|
||||
f.write("\t__wrapper_"+x["name"]+"=("+x["ret"]+" GLWRP_APIENTRY (*)("+x["args"]+"))wrapperFunc(\""+x["name"]+"\");\n")
|
||||
|
||||
f.write("\n\n")
|
||||
f.write("}\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue