From 4027ea9d5165a7fe43d6edada3c56baaa256cdb5 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 10 Dec 2014 13:16:10 -0500 Subject: [PATCH] Python: document writer.StringField MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- bindings/python/writer.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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: -- 2.34.1