From: Philippe Proulx Date: Mon, 22 Jul 2019 17:45:22 +0000 (-0400) Subject: bt2: do not require sink component's _graph_is_configured() method X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=cd1ef6f2860c2b6bf3c22ee984347029c31ac827;p=babeltrace.git bt2: do not require sink component's _graph_is_configured() method The "graph is configured" method is not required when you implement a component class in C, as it's not strictly needed to make the graph runnable, so it should not be required in Python either. A default _UserSinkComponent._graph_is_configured() method is added to make it optional. Signed-off-by: Philippe Proulx Change-Id: I3ef4e3d159af61e2d06a0a47dddc1234aed93ae1 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1740 Tested-by: jenkins --- diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index d7d42a71..f3184218 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -481,13 +481,6 @@ class _UserComponentType(type): cls, comp_cls_name, comp_cls_descr, comp_cls_help ) elif _UserSinkComponent in bases: - if not hasattr(cls, '_graph_is_configured'): - raise bt2.IncompleteUserClass( - "cannot create component class '{}': missing a _graph_is_configured() method".format( - class_name - ) - ) - if not hasattr(cls, '_consume'): raise bt2.IncompleteUserClass( "cannot create component class '{}': missing a _consume() method".format( @@ -833,6 +826,9 @@ class _UserSinkComponent(_UserComponent, _SinkComponent): def _bt_graph_is_configured_from_native(self): self._graph_is_configured() + def _graph_is_configured(self): + pass + @property def _input_ports(self): def get_input_port_count(self_ptr):