Python: add reader.IntegerFieldDeclaration.size
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Dec 2014 21:32:01 +0000 (16:32 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Feb 2015 21:15:54 +0000 (16:15 -0500)
The CTF specifications use "size" rather than "length"
for an integer type, and on the Python side,
babeltrace.writer.IntegerFieldDeclaration.size is used.

babeltrace.reader.IntegerFieldDeclaration.length is
kept here for backward compatibility reasons.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/reader.py

index 285111e82f6f02d354a8c4f860b010450edaff4e..8c07c986d93607406e60a84ce49a84516aa6baa0 100644 (file)
@@ -810,13 +810,16 @@ class IntegerFieldDeclaration(FieldDeclaration):
             return common.ByteOrder.BYTE_ORDER_UNKNOWN
 
     @property
-    def length(self):
+    def size(self):
         """
         Integer size in bits, or a negative value on error.
         """
-
         return nbt._bt_ctf_get_int_len(self._fd)
 
+    @property
+    def length(self):
+        return self.size
+
     @property
     def encoding(self):
         """
This page took 0.026532 seconds and 4 git commands to generate.