projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Implement __repr__ for _EnumerationField
[babeltrace.git]
/
bindings
/
python
/
bt2
/
bt2
/
fields.py
diff --git
a/bindings/python/bt2/bt2/fields.py
b/bindings/python/bt2/bt2/fields.py
index 507f047fa65524795ef736461c328fe5a6439f8f..2f910635c4348bd9544580457fc4f9b828682e49 100644
(file)
--- a/
bindings/python/bt2/bt2/fields.py
+++ b/
bindings/python/bt2/bt2/fields.py
@@
-366,6
+366,10
@@
class _EnumerationField(_IntegerField):
def _set_value(self, value):
self.integer_field.value = value
+ def __repr__(self):
+ labels = [repr(v.name) for v in self.mappings]
+ return '{} ({})'.format(self._value, ', '.join(labels))
+
value = property(fset=_set_value)
@property
This page took
0.022782 seconds
and
4
git commands to generate.