From 5679964cffc1ecbb1b7d4fbd6a5ab9f3a7832bba Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 16 Sep 2019 14:24:51 -0400 Subject: [PATCH] bt2: rename _FieldPath to _FieldPathConst The Babeltrace API only returns const field_path objects, so from the point of view of the user, it's always const. Rename the Python object to _FieldPathConst to reflect this. If the API ever gives access to a non-const version of field_path, then we can introduce a _FieldPath type again. Change-Id: I74a2889db48d570b4b6fbc28e43f98226dc5a053 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2055 Reviewed-by: Francis Deslauriers Reviewed-by: Philippe Proulx Tested-by: jenkins --- src/bindings/python/bt2/bt2/field_class.py | 6 +++--- src/bindings/python/bt2/bt2/field_path.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bindings/python/bt2/bt2/field_class.py b/src/bindings/python/bt2/bt2/field_class.py index 26efddee..bad407b4 100644 --- a/src/bindings/python/bt2/bt2/field_class.py +++ b/src/bindings/python/bt2/bt2/field_class.py @@ -516,7 +516,7 @@ class _OptionFieldClassConst(_FieldClassConst): if ptr is None: return - return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr) + return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr) class _OptionFieldClass(_OptionFieldClassConst, _FieldClass): @@ -761,7 +761,7 @@ class _VariantFieldClassWithSelectorConst(_VariantFieldClassConst): if ptr is None: return - return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr) + return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr) class _VariantFieldClassWithSelector( @@ -895,7 +895,7 @@ class _DynamicArrayFieldClassConst(_ArrayFieldClassConst): if ptr is None: return - return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr) + return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr) class _DynamicArrayFieldClass(_DynamicArrayFieldClassConst, _ArrayFieldClass): diff --git a/src/bindings/python/bt2/bt2/field_path.py b/src/bindings/python/bt2/bt2/field_path.py index 51f87709..c29fffe7 100644 --- a/src/bindings/python/bt2/bt2/field_path.py +++ b/src/bindings/python/bt2/bt2/field_path.py @@ -52,7 +52,7 @@ class _CurrentOptionContentFieldPathItem(_FieldPathItem): pass -class _FieldPath(object._SharedObject, collections.abc.Iterable): +class _FieldPathConst(object._SharedObject, collections.abc.Iterable): _get_ref = staticmethod(native_bt.field_path_get_ref) _put_ref = staticmethod(native_bt.field_path_put_ref) -- 2.34.1