comparison frontends/src/wix/contact_list.py @ 736:6246eb6d64a0

frontends: define the constants with classes and inheritance instance of using __builtin__
author souliane <souliane@mailoo.org>
date Sat, 23 Nov 2013 10:21:40 +0100
parents f7878ad3c846
children 378af36155c2
comparison
equal deleted inserted replaced
735:682933ca304c 736:6246eb6d64a0
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import wx 20 import wx
21 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList 21 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
22 from sat_frontends.wix.constants import Const
22 from logging import debug, info, error 23 from logging import debug, info, error
23 from cgi import escape 24 from cgi import escape
24 from sat.tools.jid import JID 25 from sat.tools.jid import JID
25 from os.path import join 26 from os.path import join
26 27
111 name = self.getCache(jid,'name') 112 name = self.getCache(jid,'name')
112 nick = self.getCache(jid,'nick') 113 nick = self.getCache(jid,'nick')
113 _show = self.getCache(jid,'show') 114 _show = self.getCache(jid,'show')
114 if _show == None or _show == 'unavailable': 115 if _show == None or _show == 'unavailable':
115 return None 116 return None
116 show = filter(lambda x : x[0] == _show, const_STATUS)[0] 117 show = filter(lambda x : x[0] == _show, Const.PRESENCE)[0]
117 118
118 #show[0]==shortcut 119 #show[0]==shortcut
119 #show[1]==human readable 120 #show[1]==human readable
120 #show[2]==color (or None) 121 #show[2]==color (or None)
121 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else "" 122 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else ""