From: Francis Deslauriers Date: Tue, 29 Oct 2019 13:00:25 +0000 (-0400) Subject: black: run `black` version 19.10b0 on entire project X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=75882e97aed48428d4a0abc32a6382be811ad994 black: run `black` version 19.10b0 on entire project Signed-off-by: Francis Deslauriers Change-Id: I2aee8b1fbd984af083fd3d0950ac6346852d2fe3 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2280 Tested-by: jenkins Reviewed-by: Simon Marchi --- diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index 9d27e6e0..980a0d45 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -946,7 +946,10 @@ class _UserSinkComponent(_UserComponent, _SinkComponentConst): def _create_input_port_message_iterator(self, input_port): utils._check_type(input_port, bt2_port._UserComponentInputPort) - status, msg_iter_ptr = native_bt.bt2_self_component_port_input_message_iterator_create_from_sink_component( + ( + status, + msg_iter_ptr, + ) = native_bt.bt2_self_component_port_input_message_iterator_create_from_sink_component( self._bt_ptr, input_port._ptr ) utils._handle_func_status(status, 'cannot create message iterator object') diff --git a/src/bindings/python/bt2/bt2/message_iterator.py b/src/bindings/python/bt2/bt2/message_iterator.py index 253fbcc7..8f3aac92 100644 --- a/src/bindings/python/bt2/bt2/message_iterator.py +++ b/src/bindings/python/bt2/bt2/message_iterator.py @@ -66,7 +66,10 @@ class _UserComponentInputPortMessageIterator(object._SharedObject, _MessageItera return bt2_message._create_from_ptr(msg_ptr) def can_seek_beginning(self): - status, res = native_bt.self_component_port_input_message_iterator_can_seek_beginning( + ( + status, + res, + ) = native_bt.self_component_port_input_message_iterator_can_seek_beginning( self._ptr ) utils._handle_func_status( @@ -87,7 +90,10 @@ class _UserComponentInputPortMessageIterator(object._SharedObject, _MessageItera def can_seek_ns_from_origin(self, ns_from_origin): utils._check_int64(ns_from_origin) - status, res = native_bt.self_component_port_input_message_iterator_can_seek_ns_from_origin( + ( + status, + res, + ) = native_bt.self_component_port_input_message_iterator_can_seek_ns_from_origin( self._ptr, ns_from_origin ) utils._handle_func_status( @@ -246,7 +252,10 @@ class _UserMessageIterator(_MessageIterator): def _create_input_port_message_iterator(self, input_port): utils._check_type(input_port, bt2_port._UserComponentInputPort) - status, msg_iter_ptr = native_bt.bt2_self_component_port_input_message_iterator_create_from_message_iterator( + ( + status, + msg_iter_ptr, + ) = native_bt.bt2_self_component_port_input_message_iterator_create_from_message_iterator( self._bt_ptr, input_port._ptr ) utils._handle_func_status(status, 'cannot create message iterator object') diff --git a/tests/bindings/python/bt2/test_message_iterator.py b/tests/bindings/python/bt2/test_message_iterator.py index d03cdb30..f2b9e2d3 100644 --- a/tests/bindings/python/bt2/test_message_iterator.py +++ b/tests/bindings/python/bt2/test_message_iterator.py @@ -719,7 +719,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_can_seek_ns_from_origin_returns_false_can_seek_beginning_forward_seekable( - self + self, ): # Test the case where: # @@ -738,7 +738,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_can_seek_ns_from_origin_returns_false_can_seek_beginning_not_forward_seekable( - self + self, ): # Test the case where: # @@ -757,7 +757,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_can_seek_ns_from_origin_returns_false_cant_seek_beginning_forward_seekable( - self + self, ): # Test the case where: # @@ -776,7 +776,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_can_seek_ns_from_origin_returns_false_cant_seek_beginning_not_forward_seekable( - self + self, ): # Test the case where: # @@ -814,7 +814,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_no_can_seek_ns_from_origin_no_seek_ns_from_origin_can_seek_beginning_forward_seekable( - self + self, ): # Test the case where: # @@ -833,7 +833,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_no_can_seek_ns_from_origin_no_seek_ns_from_origin_can_seek_beginning_not_forward_seekable( - self + self, ): # Test the case where: # @@ -852,7 +852,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_no_can_seek_ns_from_origin_no_seek_ns_from_origin_cant_seek_beginning_forward_seekable( - self + self, ): # Test the case where: # @@ -871,7 +871,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): ) def test_no_can_seek_ns_from_origin_no_seek_ns_from_origin_cant_seek_beginning_not_forward_seekable( - self + self, ): # Test the case where: # diff --git a/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py b/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py index c263d203..8c2c4560 100644 --- a/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py +++ b/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py @@ -421,7 +421,7 @@ class DiffInactivityMsgCs: src._add_output_port('out2', (test_name, cc2)) def create_msgs(msg_iter, params): - cc, = params + (cc,) = params sb_msg = msg_iter._create_message_iterator_inactivity_message(cc, 0) msg_iter._msgs = [sb_msg] diff --git a/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py b/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py index a30dbc46..91e1cc8a 100644 --- a/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py +++ b/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py @@ -457,7 +457,7 @@ class _LttngLiveViewerProtocolCodec: version, tracing_session_id, offset, seek_type ) elif cmd_type == 4: - stream_id, = self._unpack_payload('Q', data) + (stream_id,) = self._unpack_payload('Q', data) return _LttngLiveViewerGetNextDataStreamIndexEntryCommand( version, stream_id ) @@ -467,15 +467,15 @@ class _LttngLiveViewerProtocolCodec: version, stream_id, offset, req_length ) elif cmd_type == 6: - stream_id, = self._unpack_payload('Q', data) + (stream_id,) = self._unpack_payload('Q', data) return _LttngLiveViewerGetMetadataStreamDataCommand(version, stream_id) elif cmd_type == 7: - tracing_session_id, = self._unpack_payload('Q', data) + (tracing_session_id,) = self._unpack_payload('Q', data) return _LttngLiveViewerGetNewStreamInfosCommand(version, tracing_session_id) elif cmd_type == 8: return _LttngLiveViewerCreateViewerSessionCommand(version) elif cmd_type == 9: - tracing_session_id, = self._unpack_payload('Q', data) + (tracing_session_id,) = self._unpack_payload('Q', data) return _LttngLiveViewerDetachFromTracingSessionCommand( version, tracing_session_id ) @@ -674,9 +674,15 @@ class _LttngDataStreamIndex(collections.abc.Sequence): break assert len(data) == size - offset_bytes, total_size_bits, content_size_bits, timestamp_begin, timestamp_end, events_discarded, stream_class_id = struct.unpack( - fmt, data - ) + ( + offset_bytes, + total_size_bits, + content_size_bits, + timestamp_begin, + timestamp_end, + events_discarded, + stream_class_id, + ) = struct.unpack(fmt, data) self._entries.append( _LttngDataStreamIndexEntry(