comparison frontends/src/quick_frontend/quick_chat.py @ 2115:3435e8d2e8e4

quick frontends (chat): send actual value instead of None on status and state updates
author Goffi <goffi@goffi.org>
date Mon, 09 Jan 2017 23:10:16 +0100
parents 0931b5a6213c
children c42aab22c2c0
comparison
equal deleted inserted replaced
2114:dc5d214f0a3b 2115:3435e8d2e8e4
147 def status(self): 147 def status(self):
148 return self._status 148 return self._status
149 149
150 @status.setter 150 @status.setter
151 def status(self, status): 151 def status(self, status):
152 self._status = status 152 if status != self._status:
153 for w in self.widgets: 153 self._status = status
154 w.update({"status": None}) 154 for w in self.widgets:
155 w.update({"status": status})
155 156
156 def handleMe(self): 157 def handleMe(self):
157 """Check if messages starts with "/me " and change them if it is the case 158 """Check if messages starts with "/me " and change them if it is the case
158 159
159 if several messages (different languages) are presents, they all need to start with "/me " 160 if several messages (different languages) are presents, they all need to start with "/me "
217 def state(self): 218 def state(self):
218 return self._state 219 return self._state
219 220
220 @state.setter 221 @state.setter
221 def state(self, new_state): 222 def state(self, new_state):
222 self._state = new_state 223 if new_state != self._state:
223 for w in self.widgets: 224 self._state = new_state
224 w.update({"state":None}) 225 for w in self.widgets:
226 w.update({"state": new_state})
225 227
226 def update(self, update_dict=None): 228 def update(self, update_dict=None):
227 for w in self.widgets: 229 for w in self.widgets:
228 w.update(update_dict) 230 w.update(update_dict)
229 231