bt2: pass custom Python object to Python component's __init__()
[babeltrace.git] / tests / bindings / python / bt2 / utils.py
index 873a6514aa0f0034505de112c080d3a8d80de8fc..1f9a6c2768ae2e0635d55c136425b5250ac8e030 100644 (file)
@@ -23,16 +23,14 @@ import bt2
 #
 # The value returned by the callable is returned by run_in_component_init.
 
+
 def run_in_component_init(func):
     class MySink(bt2._UserSinkComponent):
-        def __init__(self, params):
+        def __init__(self, params, obj):
             nonlocal res_bound
             res_bound = func(self)
 
-        def _consume(self):
-            pass
-
-        def _graph_is_configured(self):
+        def _user_consume(self):
             pass
 
     g = bt2.Graph()
@@ -52,8 +50,10 @@ def run_in_component_init(func):
     del res_bound
     return res
 
+
 # Create an empty trace class with default values.
 
+
 def get_default_trace_class():
     def f(comp_self):
         return comp_self._create_trace_class()
This page took 0.023873 seconds and 4 git commands to generate.