Python: document writer.EnumerationField
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Dec 2014 09:31:43 +0000 (04:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Feb 2015 21:10:55 +0000 (16:10 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/writer.py

index a1f83e9d7f55c7bad4bf01efe2c38ec1a74cd1d5..0ac9e482c26a3364612580ac3105a98fa02fa316 100644 (file)
@@ -1235,10 +1235,17 @@ class IntegerField(Field):
 
 
 class EnumerationField(Field):
+    """
+    Enumeration field, based on an
+    :class:`EnumerationFieldDeclaration` object.
+    """
+
     @property
     def container(self):
         """
-        Return the enumeration's underlying container field (an integer field).
+        Underlying container (:class:`IntegerField`).
+
+        :exc:`TypeError` is raised on error.
         """
 
         container = IntegerField.__new__(IntegerField)
@@ -1252,23 +1259,23 @@ class EnumerationField(Field):
     @property
     def value(self):
         """
-        Get the enumeration field's mapping name.
+        Current label of this enumeration field (:class:`str`).
+
+        Set this attribute to an integer (:class:`int`) to change the
+        enumeration field's value.
+
+        :exc:`ValueError` is raised on error.
         """
 
         value = nbt._bt_ctf_field_enumeration_get_mapping_name(self._f)
 
         if value is None:
-            raise ValueError("Could not get enumeration's mapping name.")
+            raise ValueError("Could not get enumeration mapping name.")
 
         return value
 
     @value.setter
     def value(self, value):
-        """
-        Set the enumeration field's value. Must be an integer as mapping names
-        may be ambiguous.
-        """
-
         if not isinstance(value, int):
             raise TypeError("EnumerationField value must be an int")
 
This page took 0.025071 seconds and 4 git commands to generate.