Python bindings: make intersect_mode read-only property
authorAntoine Busque <abusque@efficios.com>
Mon, 2 May 2016 19:46:48 +0000 (15:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 May 2016 19:42:43 +0000 (15:42 -0400)
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/babeltrace.i.in

index 914ea87f8e1456b28cfb1ea9a46d2be9586cbc5b..a5cbcf5b897a6cc383538076524bf628ab6fc000 100644 (file)
@@ -141,7 +141,7 @@ class TraceCollection:
 
        def __init__(self, intersect_mode=False):
                self._tc = _bt_context_create()
-        self.intersect_mode = intersect_mode
+        self._intersect_mode = intersect_mode
 
        def __del__(self):
                _bt_context_put(self._tc)
@@ -213,6 +213,10 @@ class TraceCollection:
                        raise TypeError("in remove_trace, "
                                "argument 2 must be a TraceHandle instance")
 
+    @property
+    def intersect_mode(self):
+        return self._intersect_mode
+
        @property
        def events(self):
                """
@@ -232,9 +236,9 @@ class TraceCollection:
                """
                begin_pos_ptr = _bt_python_create_iter_pos()
                end_pos_ptr = _bt_python_create_iter_pos()
-        if not self.intersection_mode:
-                   begin_pos_ptr.type = SEEK_BEGIN
-            end_pos_ptr.type = SEEK_LAST
+               if not self.intersect_mode:
+                       begin_pos_ptr.type = SEEK_BEGIN
+                       end_pos_ptr.type = SEEK_LAST
 
                for event in self._events(begin_pos_ptr, end_pos_ptr):
                        yield event
This page took 0.034691 seconds and 4 git commands to generate.