Mercurial > libervia-backend
comparison frontends/src/primitivus/xmlui.py @ 2101:cba3323710f0
Primitivus (xmlui): use constants for BOOL_TRUE and BOOL_FALSE value
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 20 Dec 2016 21:06:42 +0100 |
parents | 2daf7b4c6756 |
children | 5defafc8ede6 |
comparison
equal
deleted
inserted
replaced
2100:fbeeba721954 | 2101:cba3323710f0 |
---|---|
155 | 155 |
156 def _xmluiSetValue(self, value): | 156 def _xmluiSetValue(self, value): |
157 self.set_state(value == "true") | 157 self.set_state(value == "true") |
158 | 158 |
159 def _xmluiGetValue(self): | 159 def _xmluiGetValue(self): |
160 return "true" if self.get_state() else "false" | 160 return C.BOOL_TRUE if self.get_state() else C.BOOL_FALSE |
161 | 161 |
162 | 162 |
163 class PrimitivusIntWidget(xmlui.IntWidget, sat_widgets.AdvancedEdit, PrimitivusEvents): | 163 class PrimitivusIntWidget(xmlui.IntWidget, sat_widgets.AdvancedEdit, PrimitivusEvents): |
164 | 164 |
165 def __init__(self, _xmlui_parent, value, read_only=False): | 165 def __init__(self, _xmlui_parent, value, read_only=False): |