Skip to content

Commit 101d61b

Browse files
committed
[master] Run black format on SConstruct files and bindings generator
1 parent 8ead641 commit 101d61b

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

SConstruct

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ if sys.version_info < (3,):
99
def decode_utf8(x):
1010
return x
1111

12-
1312
else:
1413
import codecs
1514

@@ -265,7 +264,7 @@ elif env["platform"] == "ios":
265264
env.Append(CCFLAGS=["-arch", env["ios_arch"]])
266265

267266
env.Append(CCFLAGS=["-isysroot", sdk_path])
268-
env.Append(LINKFLAGS=["-isysroot", sdk_path, "-F" + sdk_path,])
267+
env.Append(LINKFLAGS=["-isysroot", sdk_path, "-F" + sdk_path])
269268

270269
if env["target"] == "debug":
271270
env.Append(CCFLAGS=["-Og", "-g"])

binding_generator.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,9 @@ def generate_builtin_class_source(builtin_api, size, used_classes, fully_used_cl
623623
# Move constructor.
624624
result.append(f"{class_name}::{class_name}({class_name} &&other) {{")
625625
if needs_copy_instead_of_move(class_name) and copy_constructor_index >= 0:
626-
result.append(f"\tinternal::_call_builtin_constructor(_method_bindings.constructor_{copy_constructor_index}, &opaque, &other);")
626+
result.append(
627+
f"\tinternal::_call_builtin_constructor(_method_bindings.constructor_{copy_constructor_index}, &opaque, &other);"
628+
)
627629
else:
628630
result.append("\tstd::swap(opaque, other.opaque);")
629631
result.append("}")
@@ -741,7 +743,9 @@ def generate_builtin_class_source(builtin_api, size, used_classes, fully_used_cl
741743
# Move assignment.
742744
result.append(f"{class_name} &{class_name}::operator=({class_name} &&other) {{")
743745
if needs_copy_instead_of_move(class_name) and copy_constructor_index >= 0:
744-
result.append(f"\tinternal::_call_builtin_constructor(_method_bindings.constructor_{copy_constructor_index}, &opaque, &other);")
746+
result.append(
747+
f"\tinternal::_call_builtin_constructor(_method_bindings.constructor_{copy_constructor_index}, &opaque, &other);"
748+
)
745749
else:
746750
result.append("\tstd::swap(opaque, other.opaque);")
747751
result.append("\treturn *this;")
@@ -1626,6 +1630,7 @@ def is_packed_array(type_name):
16261630
"PackedVector3Array",
16271631
]
16281632

1633+
16291634
def needs_copy_instead_of_move(type_name):
16301635
"""
16311636
Those are types which need initialised data or we'll get warning spam so need a copy instead of move.
@@ -1634,6 +1639,7 @@ def needs_copy_instead_of_move(type_name):
16341639
"Dictionary",
16351640
]
16361641

1642+
16371643
def is_enum(type_name):
16381644
return type_name.startswith("enum::")
16391645

test/SConstruct

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ env.Append(CPPPATH=["src/"])
1717
sources = Glob("src/*.cpp")
1818

1919
if env["platform"] == "osx":
20-
library = env.SharedLibrary("demo/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(env["platform"], env["target"], env["platform"], env["target"]), source=sources)
20+
library = env.SharedLibrary(
21+
"demo/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
22+
env["platform"], env["target"], env["platform"], env["target"]
23+
),
24+
source=sources,
25+
)
2126
else:
22-
library = env.SharedLibrary("demo/bin/libgdexample.{}.{}.{}{}".format(env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"]), source=sources)
27+
library = env.SharedLibrary(
28+
"demo/bin/libgdexample.{}.{}.{}{}".format(
29+
env["platform"], env["target"], env["arch_suffix"], env["SHLIBSUFFIX"]
30+
),
31+
source=sources,
32+
)
2333

2434
Default(library)

0 commit comments

Comments
 (0)