bt2: rename `_MessageIteratorConfiguration.can_seek_forward()`
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 21 Oct 2024 19:54:02 +0000 (15:54 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Nov 2024 16:17:44 +0000 (11:17 -0500)
This method's name suggests that it's public and can be called by the
user, but that's not the case, since it is overwritten by the write-only
property just below.  Example:

      File
    "/home/smarchi/build/babeltrace/src/bindings/python/bt2/build/build_lib/bt2/message_iterator.py",
    line 142, in _bt_init_from_native
        self.__init__(config, self_output_port)
      File "/home/smarchi/src/babeltrace/test.py", line 11, in __init__
        config.can_seek_forward(False)
        ^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: property 'can_seek_forward' of '_MessageIteratorConfiguration'
    object has no getter

Rename it to something that's more obviously not intended for the user.

Change-Id: Ibef9cd8297569e2d4daea01ede00f3f0735abd90
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13387
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/message_iterator.py

index 8703e90be10f095c8a5f0cb96d9deade24ebe488..162d61712f960c3ee429978973329bc112b3b055 100644 (file)
@@ -103,13 +103,13 @@ class _MessageIteratorConfiguration:
     def __init__(self, ptr):
         self._ptr = ptr
 
-    def can_seek_forward(self, value):
+    def _set_can_seek_forward(self, value):
         bt2_utils._check_bool(value)
         native_bt.self_message_iterator_configuration_set_can_seek_forward(
             self._ptr, value
         )
 
-    can_seek_forward = property(fset=can_seek_forward)
+    can_seek_forward = property(fset=_set_can_seek_forward)
 
 
 # This is extended by the user to implement component classes in Python.  It
This page took 0.028263 seconds and 4 git commands to generate.