comparison frontends/src/wix/xmlui.py @ 1011:5a6354ff468c

wix: use of new logging system
author Goffi <goffi@goffi.org>
date Mon, 05 May 2014 20:12:21 +0200
parents 68faf7d77a42
children 7a39ae3950f7
comparison
equal deleted inserted replaced
1010:73a0b7f94674 1011:5a6354ff468c
19 19
20 20
21 21
22 from sat.core.i18n import _ 22 from sat.core.i18n import _
23 import wx 23 import wx
24 from logging import debug, info, warning, error 24 from sat.core.log import getLogger
25 log = getLogger(__name__)
25 from sat.tools.jid import JID 26 from sat.tools.jid import JID
26 from sat_frontends.tools import xmlui 27 from sat_frontends.tools import xmlui
27 from sat_frontends.constants import Const 28 from sat_frontends.constants import Const
28 29
29 30
142 143
143 def _xmluiSelectValue(self, value): 144 def _xmluiSelectValue(self, value):
144 try: 145 try:
145 label = [label for label, _value in self._xmlui_attr_map.items() if _value == value][0] 146 label = [label for label, _value in self._xmlui_attr_map.items() if _value == value][0]
146 except IndexError: 147 except IndexError:
147 warning(_("Can't find value [%s] to select" % value)) 148 log.warning(_("Can't find value [%s] to select" % value))
148 return 149 return
149 for idx in xrange(self.GetCount()): 150 for idx in xrange(self.GetCount()):
150 self.SetSelection(idx, self.GetString(idx) == label) 151 self.SetSelection(idx, self.GetString(idx) == label)
151 152
152 def _xmluiSelectValues(self, values): 153 def _xmluiSelectValues(self, values):
318 button = event.GetEventObject() 319 button = event.GetEventObject()
319 super(XMLUI, self).onFormSubmitted(button) 320 super(XMLUI, self).onFormSubmitted(button)
320 321
321 def onClose(self, event): 322 def onClose(self, event):
322 """Close event: we have to send the form.""" 323 """Close event: we have to send the form."""
323 debug(_("close")) 324 log.debug(_("close"))
324 if self.type == 'param': 325 if self.type == 'param':
325 self.onSaveParams() 326 self.onSaveParams()
326 else: 327 else:
327 self._xmluiClose() 328 self._xmluiClose()
328 event.Skip() 329 event.Skip()