comparison cagou/core/common.py @ 312:772c170b47a9

Python3 port: /!\ Cagou now runs with Python 3.6+ Port has been done in the same way as for backend (check backend commit b2d067339de3 message for details).
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:14:22 +0200
parents 1b835bcfa663
children e2b51663d8b8
comparison
equal deleted inserted replaced
311:a0d978d3ce84 312:772c170b47a9
31 import json 31 import json
32 from sat.core import log as logging 32 from sat.core import log as logging
33 33
34 log = logging.getLogger(__name__) 34 log = logging.getLogger(__name__)
35 35
36 UNKNOWN_SYMBOL = u'Unknown symbol name' 36 UNKNOWN_SYMBOL = 'Unknown symbol name'
37 37
38 38
39 class IconButton(ButtonBehavior, Image): 39 class IconButton(ButtonBehavior, Image):
40 pass 40 pass
41 41
94 94
95 def on_symbol(self, instance, symbol): 95 def on_symbol(self, instance, symbol):
96 try: 96 try:
97 code = self.symbol_map[symbol] 97 code = self.symbol_map[symbol]
98 except KeyError: 98 except KeyError:
99 log.warning(_(u"Invalid symbol {symbol}").format(symbol=symbol)) 99 log.warning(_("Invalid symbol {symbol}").format(symbol=symbol))
100 else: 100 else:
101 self.text = unichr(code) 101 self.text = chr(code)
102 102
103 103
104 class SymbolButton(ButtonBehavior, Symbol): 104 class SymbolButton(ButtonBehavior, Symbol):
105 pass 105 pass
106 106