mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
SCons: Ensure with
statement where applicable
This commit is contained in:
parent
0ace0a1292
commit
fb299d0fb1
21 changed files with 1649 additions and 1699 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue