# Straightforward sink that creates one input port (`in`) and consumes from
# it.
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_consume(self):
the_output_port_from_iter = self_port_output
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
nonlocal the_output_port_from_source
the_output_port_from_source = self._add_output_port('out', 'user data')
src_iter_initialized = True
class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
class MyFilterIter(bt2._UserMessageIterator):
return next(self._up_iter)
class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
self._add_output_port('out')
raise ValueError('Very bad error')
class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
class MyFilterIter(bt2._UserMessageIterator):
)
class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
self._add_output_port('out')
finalized = True
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
finalized = False
salut = self._component._salut
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
self._salut = 23
self.assertEqual(self_port_output.addr, port.addr)
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
called = False
addr = self.addr
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
addr = None
return self._msgs.pop(0)
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
tc = self._create_trace_class()
sc = tc.create_stream_class(supports_packets=True)
ec = sc.create_event_class()
raise bt2.TryAgain
class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_output_port('out')
class MyFilterIter(bt2._UserMessageIterator):
return self._upstream_iter.can_seek_beginning()
class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
input_port = self._add_input_port('in')
self._add_output_port('out', input_port)
MySourceIter._user_can_seek_ns_from_origin = user_can_seek_ns_from_origin
class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
tc = self._create_trace_class()
sc = tc.create_stream_class(supports_packets=True)
ec = sc.create_event_class()
self._upstream_iter.seek_ns_from_origin(ns_from_origin)
class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
self._add_output_port('out')
class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
def test_can_seek_beginning(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
# Test an iterator without a _user_can_seek_beginning method, but with
# a _user_seek_beginning method.
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
# Test an iterator without a _user_can_seek_beginning method, without
# a _user_seek_beginning method.
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_can_seek_beginning_user_error(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_can_seek_beginning_wrong_return_value(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_seek_beginning(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_seek_beginning_user_error(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
def test_can_seek_ns_from_origin(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
# Test an iterator without a _user_can_seek_ns_from_origin method, but
# with a _user_seek_ns_from_origin method.
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
# Test an iterator without a _user_can_seek_ns_from_origin method, but
# with a _user_seek_beginning method.
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
# Test an iterator without a _user_can_seek_ns_from_origin method
# and no other related method.
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_can_seek_ns_from_origin_user_error(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_can_seek_ns_from_origin_wrong_return_value(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):
def test_seek_ns_from_origin(self):
class MySink(bt2._UserSinkComponent):
- def __init__(self, params, obj):
+ def __init__(self, config, params, obj):
self._add_input_port('in')
def _user_graph_is_configured(self):