tests: clean up test_trimmer
[babeltrace.git] / bindings / python / babeltrace / babeltrace / writer.py
index 61d28a5161cf1729ff729e68c0fe9f4c66c48836..21b7e6f5cb6395c63bef842411250db4c70796b8 100644 (file)
@@ -27,6 +27,7 @@
 import babeltrace.common as common
 import bt2
 
+
 class EnumerationMapping:
     """
     Mapping from an enumeration label to a range of integers.
@@ -178,8 +179,8 @@ class Clock:
     @offset_seconds.setter
     def offset_seconds(self, offset_s):
         try:
-            self._clock.offset = bt2.ClockClassOffet(offset_s,
-                                                     self._clock.offset.cycles)
+            self._clock.offset = bt2.ClockClassOffset(offset_s,
+                                                      self._clock.offset.cycles)
         except:
             raise ValueError("Invalid offset value.")
 
@@ -202,8 +203,8 @@ class Clock:
     @offset.setter
     def offset(self, offset):
         try:
-            self._clock.offset = bt2.ClockClassOffet(
-                self._clock.offset.seconds, offset)
+            self._clock.offset = bt2.ClockClassOffset(self._clock.offset.seconds,
+                                                      offset)
         except:
             raise ValueError("Invalid offset value.")
 
@@ -334,6 +335,7 @@ _ENCODING_TO_BT2_ENCODING = {
     common.CTFStringEncoding.UTF8: bt2.Encoding.UTF8,
 }
 
+
 class FieldDeclaration:
     """
     Base class of all field declarations. This class is not meant to
@@ -557,7 +559,7 @@ class EnumerationFieldDeclaration(FieldDeclaration):
         """
 
         try:
-            self._field_type.append_mapping(name, range_start, range_end)
+            self._field_type.add_mapping(name, range_start, range_end)
         except:
             raise ValueError(
                 "Could not add mapping to enumeration declaration.")
@@ -679,7 +681,6 @@ class FloatingPointFieldDeclaration(FieldDeclaration):
             raise TypeError(
                 "Could not get Floating point exponent digit count")
 
-
     @exponent_digits.setter
     def exponent_digits(self, exponent_digits):
         try:
@@ -705,7 +706,6 @@ class FloatingPointFieldDeclaration(FieldDeclaration):
             raise TypeError(
                 "Could not get Floating point mantissa digit count")
 
-
     @mantissa_digits.setter
     def mantissa_digits(self, mantissa_digits):
         try:
@@ -803,7 +803,7 @@ class VariantFieldDeclaration(FieldDeclaration):
             raise TypeError("Invalid tag type; must be of type EnumerationFieldDeclaration.")
 
         self._field_type = bt2.VariantFieldType(tag_name=tag_name,
-                                        tag_field_type=enum_tag._field_type)
+                                                tag_field_type=enum_tag._field_type)
         super().__init__()
 
     @property
@@ -1583,6 +1583,7 @@ class Event:
         except:
             raise ValueError("Invalid stream context field.")
 
+
 class StreamClass:
     """
     A stream class contains the properties of specific
@@ -1606,8 +1607,8 @@ class StreamClass:
         try:
             # Set default event header and packet context.
             event_header_type = bt2.StructureFieldType()
-            uint32_ft = bt2.IntegerFieldType(32, is_signed=False)
-            uint64_ft = bt2.IntegerFieldType(32, is_signed=False)
+            uint32_ft = bt2.IntegerFieldType(32)
+            uint64_ft = bt2.IntegerFieldType(64)
             event_header_type.append_field('id', uint32_ft)
             event_header_type.append_field('timestamp', uint64_ft)
 
@@ -1954,7 +1955,7 @@ class Writer:
             raise TypeError("Value type is not supported.")
 
         try:
-            self._w.trace.env += {name: value}
+            self._w.trace.env[name] = value
         except:
             raise ValueError("Could not add environment field to trace.")
 
This page took 0.025713 seconds and 4 git commands to generate.