Skip to content

Commit d02f24a

Browse files
committed
Fix style due to new black version
1 parent e6cd482 commit d02f24a

File tree

8 files changed

+39
-17
lines changed

8 files changed

+39
-17
lines changed

pythonscript/embedded/godot/hazmat/ffi/editor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from pythonscriptcffi import ffi, lib
22

33
from godot.hazmat.tools import (
4-
godot_string_to_pyobj, godot_string_from_pyobj_for_ffi_return, variant_to_pyobj
4+
godot_string_to_pyobj,
5+
godot_string_from_pyobj_for_ffi_return,
6+
variant_to_pyobj,
57
)
68
from godot.bindings import PoolStringArray
79
import godot.globals

pythonscript/embedded/godot/hazmat/ffi/script.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
from godot.hazmat.base import BaseObject, get_exposed_class_per_module
77
from godot.hazmat.gc_protector import connect_handle
88
from godot.hazmat.tools import (
9-
godot_string_to_pyobj, godot_string_from_pyobj, py_to_gd_type
9+
godot_string_to_pyobj,
10+
godot_string_from_pyobj,
11+
py_to_gd_type,
1012
)
1113
from godot.bindings import Dictionary, Array
1214

pythonscript/embedded/godot/hazmat/tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,16 @@ def variant_to_pyobj(p_gdvar):
178178
elif gdtype == lib.GODOT_VARIANT_TYPE_POOL_VECTOR2_ARRAY:
179179
p_raw = godot_pool_vector2_array_alloc(initialized=False)
180180
p_raw[0] = lib.godot_variant_as_pool_vector2_array(p_gdvar)
181-
return godot_bindings_module.PoolVector2Array.build_from_gdobj(p_raw, steal=True)
181+
return godot_bindings_module.PoolVector2Array.build_from_gdobj(
182+
p_raw, steal=True
183+
)
182184

183185
elif gdtype == lib.GODOT_VARIANT_TYPE_POOL_VECTOR3_ARRAY:
184186
p_raw = godot_pool_vector3_array_alloc(initialized=False)
185187
p_raw[0] = lib.godot_variant_as_pool_vector3_array(p_gdvar)
186-
return godot_bindings_module.PoolVector3Array.build_from_gdobj(p_raw, steal=True)
188+
return godot_bindings_module.PoolVector3Array.build_from_gdobj(
189+
p_raw, steal=True
190+
)
187191

188192
elif gdtype == lib.GODOT_VARIANT_TYPE_POOL_COLOR_ARRAY:
189193
p_raw = godot_pool_color_array_alloc(initialized=False)

tests/bindings/test_dictionary.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def test_delitem(self):
103103
del v[object()]
104104

105105
def test_update(self):
106-
v = Dictionary({'a': 1, 'b': 2, 'c': 3})
107-
v.update({'a': 'one', 'd': 'four'})
108-
v.update(Dictionary({'b': 'two', 'e': 'five'}))
109-
assert set(v.keys()) == {'a', 'b', 'c', 'd', 'e'}
110-
assert set(v.values()) == {'one', 'two', 3, 'four', 'five'}
106+
v = Dictionary({"a": 1, "b": 2, "c": 3})
107+
v.update({"a": "one", "d": "four"})
108+
v.update(Dictionary({"b": "two", "e": "five"}))
109+
assert set(v.keys()) == {"a", "b", "c", "d", "e"}
110+
assert set(v.values()) == {"one", "two", 3, "four", "five"}
111111

112112
def test_contains(self):
113113
v = Dictionary({"a": 1, 2: "foo", 0.5: Vector2()})

tests/bindings/test_dynamic_bindings.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import pytest
22

33
from godot.bindings import (
4-
Object, Node, Viewport, Input, LineEdit, Engine, _Engine, KEY_ESCAPE, OK, FAILED
4+
Object,
5+
Node,
6+
Viewport,
7+
Input,
8+
LineEdit,
9+
Engine,
10+
_Engine,
11+
KEY_ESCAPE,
12+
OK,
13+
FAILED,
514
)
615

716

tests/bindings/test_memory_leaks.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_base_dynamic_memory_leak_check():
4242

4343

4444
def test_base_builtin_memory_leak():
45+
4546
def fn():
4647
v = bindings.Vector3()
4748
v.x = 42
@@ -51,21 +52,23 @@ def fn():
5152

5253

5354
def test_dictionary_memory_leak():
55+
5456
def fn():
5557
v = bindings.Dictionary()
56-
v['foo'] = OS
57-
v.update({'a': 1, 'b': 2.0, 'c': 'three'})
58-
v['foo']
58+
v["foo"] = OS
59+
v.update({"a": 1, "b": 2.0, "c": "three"})
60+
v["foo"]
5961
[x for x in v.items()]
60-
del v['a']
62+
del v["a"]
6163

6264
check_memory_leak(fn)
6365

6466

6567
def test_array_memory_leak():
68+
6669
def fn():
6770
v = bindings.Array()
68-
v.append('x')
71+
v.append("x")
6972
v += [1, 2, 3]
7073
v[0]
7174
[x for x in v]
@@ -74,6 +77,7 @@ def fn():
7477

7578

7679
def test_pool_int_array_memory_leak():
80+
7781
def fn():
7882
v = bindings.PoolIntArray()
7983
v.append(42)
@@ -84,6 +88,7 @@ def fn():
8488

8589

8690
def test_pool_string_array_memory_leak():
91+
8792
def fn():
8893
v = bindings.PoolStringArray()
8994
v.append("fooo")
@@ -94,6 +99,7 @@ def fn():
9499

95100

96101
def test_object_memory_leak():
102+
97103
def fn():
98104
v = bindings.Node()
99105
v.free()

tests/bindings/test_pool_arrays.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def test_add_with_non_PoolBytearray(self):
9090
arr4 = [values[0]] + list(pba)
9191
assert arr4 == values
9292

93-
9493
@pytest.mark.parametrize("arg", [None, 0, "foo", Vector2(), Node()])
9594
def test_bad_add(self, arg):
9695
with pytest.raises(TypeError):

tools/multi_platform_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def fetch_build(src, version, target):
3333
urlretrieve(
3434
url,
3535
filename=build_zipname,
36-
reporthook=lambda *args: print(".", end="", flush=True)
36+
reporthook=lambda *args: print(".", end="", flush=True),
3737
)
3838
return ZipFile(cache_file)
3939

0 commit comments

Comments
 (0)