You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
SCons: Ensure with statement where applicable
This commit is contained in:
@@ -124,17 +124,15 @@ def generate_export_icons(platform_path, platform_name):
|
||||
svg_names.append("run_icon")
|
||||
|
||||
for name in svg_names:
|
||||
svgf = open(export_path + "/" + name + ".svg", "rb")
|
||||
b = svgf.read(1)
|
||||
svg_str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
|
||||
svg_str += " static const char *_" + platform_name + "_" + name + '_svg = "'
|
||||
while len(b) == 1:
|
||||
svg_str += "\\" + hex(ord(b))[1:]
|
||||
with open(export_path + "/" + name + ".svg", "rb") as svgf:
|
||||
b = svgf.read(1)
|
||||
svg_str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
|
||||
svg_str += " static const char *_" + platform_name + "_" + name + '_svg = "'
|
||||
while len(b) == 1:
|
||||
svg_str += "\\" + hex(ord(b))[1:]
|
||||
b = svgf.read(1)
|
||||
|
||||
svg_str += '";\n'
|
||||
|
||||
svgf.close()
|
||||
svg_str += '";\n'
|
||||
|
||||
# NOTE: It is safe to generate this file here, since this is still executed serially.
|
||||
wf = export_path + "/" + name + "_svg.gen.h"
|
||||
|
||||
Reference in New Issue
Block a user