summaryrefslogtreecommitdiff
path: root/lib/protocol_benchmarks.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-10-26 10:35:50 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-10-26 10:35:50 +0100
commit506a49fd49e028055378af2e35d6022e6bb99b9c (patch)
treef039ddd3edeb5eb70d9e6e86278131bd2b6dd434 /lib/protocol_benchmarks.py
parent8494b500712d06be15b53aebaed730c88e5c2b20 (diff)
blacken code; do not run lint check on external Python libraries
Diffstat (limited to 'lib/protocol_benchmarks.py')
-rwxr-xr-xlib/protocol_benchmarks.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/protocol_benchmarks.py b/lib/protocol_benchmarks.py
index d41979f..7f3e2f2 100755
--- a/lib/protocol_benchmarks.py
+++ b/lib/protocol_benchmarks.py
@@ -328,8 +328,10 @@ class ArduinoJSON(DummyProtocol):
child = enc_node + "l"
while child in self.children:
child += "_"
- self.enc_buf += "ArduinoJson::JsonArray& {} = {}.createNestedArray();\n".format(
- child, enc_node
+ self.enc_buf += (
+ "ArduinoJson::JsonArray& {} = {}.createNestedArray();\n".format(
+ child, enc_node
+ )
)
self.children.add(child)
self.from_json(value, child)
@@ -338,8 +340,10 @@ class ArduinoJSON(DummyProtocol):
child = enc_node + "o"
while child in self.children:
child += "_"
- self.enc_buf += "ArduinoJson::JsonObject& {} = {}.createNestedObject();\n".format(
- child, enc_node
+ self.enc_buf += (
+ "ArduinoJson::JsonObject& {} = {}.createNestedObject();\n".format(
+ child, enc_node
+ )
)
self.children.add(child)
self.from_json(value, child)
@@ -616,11 +620,15 @@ class CapnProtoC(DummyProtocol):
[len(value)],
)
for i, elem in enumerate(value):
- self.enc_buf += "capn_set{:d}({}.{}, {:d}, capn_from_f{:d}({:f}));\n".format(
- self.float_bits, self.name, key, i, self.float_bits, elem
+ self.enc_buf += (
+ "capn_set{:d}({}.{}, {:d}, capn_from_f{:d}({:f}));\n".format(
+ self.float_bits, self.name, key, i, self.float_bits, elem
+ )
)
- self.dec_buf += "kout << capn_to_f{:d}(capn_get{:d}({}.{}, {:d}));\n".format(
- self.float_bits, self.float_bits, self.name, key, i
+ self.dec_buf += (
+ "kout << capn_to_f{:d}(capn_get{:d}({}.{}, {:d}));\n".format(
+ self.float_bits, self.float_bits, self.name, key, i
+ )
)
self.assign_and_kout(
self.float_type,
@@ -1196,8 +1204,10 @@ class NanoPB(DummyProtocol):
self.cc_encoders += (
"if (!pb_encode_tag_for_field(stream, field)) return false;\n"
)
- self.cc_encoders += 'return pb_encode_string(stream, (uint8_t*)"{}", {:d});\n'.format(
- value, len(value)
+ self.cc_encoders += (
+ 'return pb_encode_string(stream, (uint8_t*)"{}", {:d});\n'.format(
+ value, len(value)
+ )
)
self.cc_encoders += "}\n"
self.enc_buf += "msg.{}{}.funcs.encode = encode_{};\n".format(