bt2: prepend `_user` to overridable protected methods
[babeltrace.git] / tests / bindings / python / bt2 / utils.py
index 768462ec09993e7acd6de544c97879e163e1e9ff..46be6fe22524ac369b5057616a671f4c873be668 100644 (file)
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2019 EfficiOS Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; only version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+
 import bt2
 
 # Run callable `func` in the context of a component's __init__ method.  The
@@ -5,13 +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):
             nonlocal res_bound
             res_bound = func(self)
 
-        def _consume(self):
+        def _user_consume(self):
             pass
 
     g = bt2.Graph()
@@ -31,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.024696 seconds and 4 git commands to generate.