From: Philippe Proulx Date: Wed, 10 Dec 2014 18:16:10 +0000 (-0500) Subject: Python: document writer.StringField X-Git-Tag: v2.0.0-pre1~1355 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=4027ea9d5165a7fe43d6edada3c56baaa256cdb5 Python: document writer.StringField Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/bindings/python/writer.py b/bindings/python/writer.py index d862cd82..f3a3f145 100644 --- a/bindings/python/writer.py +++ b/bindings/python/writer.py @@ -1442,20 +1442,24 @@ class SequenceField(Field): class StringField(Field): + """ + String (NULL-terminated array of bytes) field. + """ + @property def value(self): """ - Get a string field's value. + String value (:class:`str`). + + Set this attribute to change the string's value. + + :exc:`ValueError` or :exc:`TypeError` are raised on error. """ return nbt._bt_ctf_field_string_get_value(self._f) @value.setter def value(self, value): - """ - Set a string field's value. - """ - ret = nbt._bt_ctf_field_string_set_value(self._f, str(value)) if ret < 0: