~lttng/babeltrace/trunk

« back to all changes in this revision

Viewing changes to src/bindings/python/bt2/bt2/field_class.py

  • Committer: Philippe Proulx
  • Author(s): Simon Marchi
  • Date: 2023-09-21 17:29:44 UTC
  • Revision ID: git-v1:c345b07873b0cb0ed344bde32a322a1b1edf60ae
python: remove internal `import bt2` imports

Standardize the internal imports to import specific modules like this:

    from bt2 import foo as bt2_foo

... instead of importing the complete bt2 package.

Change-Id: I32eb223a8bcfe841020a2aafb976f121dadd8680
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10388
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import collections.abc
9
9
from bt2 import field_path as bt2_field_path
10
10
from bt2 import integer_range_set as bt2_integer_range_set
 
11
from bt2 import error as bt2_error
11
12
from bt2 import value as bt2_value
12
 
import bt2
13
13
 
14
14
 
15
15
def _obj_type_from_field_class_ptr_template(type_map, ptr):
64
64
 
65
65
    def _check_create_status(self, ptr):
66
66
        if ptr is None:
67
 
            raise bt2._MemoryError(
 
67
            raise bt2_error._MemoryError(
68
68
                "cannot create {} field class object".format(self._NAME.lower())
69
69
            )
70
70
 
478
478
 
479
479
        if user_attributes is not None:
480
480
            # check now that user attributes are valid
481
 
            user_attributes_value = bt2.create_value(user_attributes)
 
481
            user_attributes_value = bt2_value.create_value(user_attributes)
482
482
 
483
483
        status = native_bt.field_class_structure_append_member(
484
484
            self._ptr, name, field_class._ptr
819
819
 
820
820
        if user_attributes is not None:
821
821
            # check now that user attributes are valid
822
 
            user_attributes_value = bt2.create_value(user_attributes)
 
822
            user_attributes_value = bt2_value.create_value(user_attributes)
823
823
 
824
824
        status = native_bt.field_class_variant_without_selector_append_option(
825
825
            self._ptr, name, field_class._ptr
873
873
 
874
874
        if user_attributes is not None:
875
875
            # check now that user attributes are valid
876
 
            user_attributes_value = bt2.create_value(user_attributes)
 
876
            user_attributes_value = bt2_value.create_value(user_attributes)
877
877
 
878
878
        # TODO: check overlaps (precondition of self._append_option())
879
879