Python bindings: add has_intersection property to TraceCollection
authorAntoine Busque <abusque@efficios.com>
Mon, 2 May 2016 19:50:02 +0000 (15:50 -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 a5cbcf5b897a6cc383538076524bf628ab6fc000..f9d2c736dff41636ec4b817c1978a5e662499800 100644 (file)
@@ -217,6 +217,10 @@ class TraceCollection:
     def intersect_mode(self):
         return self._intersect_mode
 
+    @property
+    def has_intersection(self):
+        return _bt_python_has_intersection(self._tc)
+
        @property
        def events(self):
                """
@@ -289,8 +293,7 @@ class TraceCollection:
 
        def _events(self, begin_pos_ptr, end_pos_ptr):
         if self.intersect_mode:
-            has_intersection = _bt_python_has_intersection(self._tc)
-            if not has_intersection:
+            if not self.has_intersection:
                 # There are no events to provide.
                 return
 
This page took 0.034627 seconds and 4 git commands to generate.