summaryrefslogtreecommitdiff
path: root/editor/icons
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-30 15:07:00 +0200
committerGitHub <noreply@github.com>2020-03-30 15:07:00 +0200
commitb383484e445b1554c811556181a7815e0308fd62 (patch)
treedc038e9d922bc93b2673c52f59fc1eaf862075e1 /editor/icons
parent0168709978154a89f137b44f33647e5d28a46250 (diff)
parent3644036fd3d8678ac44695cc49ae63c4aaeb1b97 (diff)
Merge pull request #37421 from akien-mga/python-format-black
SCons: Format buildsystem files with psf/black
Diffstat (limited to 'editor/icons')
-rw-r--r--editor/icons/SCsub14
-rw-r--r--editor/icons/editor_icons_builders.py14
2 files changed, 14 insertions, 14 deletions
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index b39c74c66a..f0d51999f0 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -1,21 +1,21 @@
#!/usr/bin/env python
-Import('env')
+Import("env")
from platform_methods import run_in_subprocess
import editor_icons_builders
-make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builders.make_editor_icons_action),
- suffix='.h',
- src_suffix='.svg')
+make_editor_icons_builder = Builder(
+ action=run_in_subprocess(editor_icons_builders.make_editor_icons_action), suffix=".h", src_suffix=".svg"
+)
-env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
+env["BUILDERS"]["MakeEditorIconsBuilder"] = make_editor_icons_builder
# Editor's own icons
icon_sources = Glob("*.svg")
# Module icons
for module_icons in env.module_icons_paths:
- icon_sources += Glob('#' + module_icons + "/*.svg")
+ icon_sources += Glob("#" + module_icons + "/*.svg")
-env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', icon_sources)])
+env.Alias("editor_icons", [env.MakeEditorIconsBuilder("#editor/editor_icons.gen.h", icon_sources)])
diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py
index a00f21c265..d7145abe50 100644
--- a/editor/icons/editor_icons_builders.py
+++ b/editor/icons/editor_icons_builders.py
@@ -22,16 +22,16 @@ def make_editor_icons_action(target, source, env):
icons_string.write('\t"')
- with open(fname, 'rb') as svgf:
+ with open(fname, "rb") as svgf:
b = svgf.read(1)
- while(len(b) == 1):
+ while len(b) == 1:
icons_string.write("\\" + str(hex(ord(b)))[1:])
b = svgf.read(1)
icons_string.write('"')
if fname != svg_icons[-1]:
icons_string.write(",")
- icons_string.write('\n')
+ icons_string.write("\n")
s = StringIO()
s.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@@ -40,7 +40,7 @@ def make_editor_icons_action(target, source, env):
s.write("static const int editor_icons_count = {};\n".format(len(svg_icons)))
s.write("static const char *editor_icons_sources[] = {\n")
s.write(icons_string.getvalue())
- s.write('};\n\n')
+ s.write("};\n\n")
s.write("static const char *editor_icons_names[] = {\n")
# this is used to store the indices of thumbnail icons
@@ -63,11 +63,11 @@ def make_editor_icons_action(target, source, env):
if fname != svg_icons[-1]:
s.write(",")
- s.write('\n')
+ s.write("\n")
index += 1
- s.write('};\n')
+ s.write("};\n")
if thumb_medium_indices:
s.write("\n\n")
@@ -91,5 +91,5 @@ def make_editor_icons_action(target, source, env):
icons_string.close()
-if __name__ == '__main__':
+if __name__ == "__main__":
subprocess_main(globals())