You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +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:
@@ -3,7 +3,7 @@
|
||||
import sys
|
||||
|
||||
if (len(sys.argv)!=2):
|
||||
print("Pass me a .fnt argument!")
|
||||
print("Pass me a .fnt argument!")
|
||||
|
||||
f = open(sys.argv[1],"rb")
|
||||
|
||||
@@ -19,39 +19,39 @@ font_cc=0
|
||||
|
||||
while(l!=""):
|
||||
|
||||
fs = l.strip().find(" ")
|
||||
if (fs==-1):
|
||||
l=f.readline()
|
||||
continue
|
||||
t = l[0:fs]
|
||||
fs = l.strip().find(" ")
|
||||
if (fs==-1):
|
||||
l=f.readline()
|
||||
continue
|
||||
t = l[0:fs]
|
||||
|
||||
dv = l[fs+1:].split(" ")
|
||||
d = {}
|
||||
for x in dv:
|
||||
if (x.find("=")==-1):
|
||||
continue
|
||||
s = x.split("=")
|
||||
d[ s[0] ] = s[1]
|
||||
dv = l[fs+1:].split(" ")
|
||||
d = {}
|
||||
for x in dv:
|
||||
if (x.find("=")==-1):
|
||||
continue
|
||||
s = x.split("=")
|
||||
d[ s[0] ] = s[1]
|
||||
|
||||
|
||||
if (t=="common"):
|
||||
font_height=d["lineHeight"]
|
||||
font_ascent=d["base"]
|
||||
if (t=="common"):
|
||||
font_height=d["lineHeight"]
|
||||
font_ascent=d["base"]
|
||||
|
||||
if (t=="char"):
|
||||
font_chars.append(d["id"])
|
||||
font_chars.append(d["x"])
|
||||
font_chars.append(d["y"])
|
||||
font_chars.append(d["width"])
|
||||
font_chars.append(d["height"])
|
||||
font_chars.append(d["xoffset"])
|
||||
font_chars.append(d["yoffset"])
|
||||
font_chars.append(d["xadvance"])
|
||||
font_cc+=1
|
||||
if (t=="char"):
|
||||
font_chars.append(d["id"])
|
||||
font_chars.append(d["x"])
|
||||
font_chars.append(d["y"])
|
||||
font_chars.append(d["width"])
|
||||
font_chars.append(d["height"])
|
||||
font_chars.append(d["xoffset"])
|
||||
font_chars.append(d["yoffset"])
|
||||
font_chars.append(d["xadvance"])
|
||||
font_cc+=1
|
||||
|
||||
|
||||
|
||||
l = f.readline()
|
||||
l = f.readline()
|
||||
|
||||
|
||||
print("static const int _bi_font_"+name+"_height="+str(font_height)+";")
|
||||
@@ -60,11 +60,11 @@ print("static const int _bi_font_"+name+"_charcount="+str(font_cc)+";")
|
||||
cstr="static const int _bi_font_"+name+"_characters={"
|
||||
for i in range(len(font_chars)):
|
||||
|
||||
c=font_chars[i]
|
||||
if (i>0):
|
||||
cstr+=", "
|
||||
cstr+=c
|
||||
c=font_chars[i]
|
||||
if (i>0):
|
||||
cstr+=", "
|
||||
cstr+=c
|
||||
|
||||
cstr+=("};")
|
||||
|
||||
print(cstr)
|
||||
print(cstr)
|
||||
|
||||
Reference in New Issue
Block a user