Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_app.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 | 682933ca304c |
children | 378af36155c2 |
comparison
equal
deleted
inserted
replaced
735:682933ca304c | 736:6246eb6d64a0 |
---|---|
23 from sat_frontends.bridge.DBus import DBusBridgeFrontend | 23 from sat_frontends.bridge.DBus import DBusBridgeFrontend |
24 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError | 24 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError |
25 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate | 25 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate |
26 from optparse import OptionParser | 26 from optparse import OptionParser |
27 | 27 |
28 import sat_frontends.quick_frontend.constants | 28 from sat_frontends.quick_frontend.constants import Const |
29 | 29 |
30 import gettext | 30 import gettext |
31 gettext.install('sat_frontend', unicode=True) | 31 gettext.install('sat_frontend', unicode=True) |
32 | 32 |
33 class QuickApp(object): | 33 class QuickApp(object): |
281 | 281 |
282 timestamp = extra.get('archive') | 282 timestamp = extra.get('archive') |
283 self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') | 283 self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') |
284 | 284 |
285 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@"): | 285 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@"): |
286 if to_jid.startswith(const_PRIVATE_PREFIX): | 286 if to_jid.startswith(Const.PRIVATE_PREFIX): |
287 to_jid = unescapePrivate(to_jid) | 287 to_jid = unescapePrivate(to_jid) |
288 mess_type = "chat" | 288 mess_type = "chat" |
289 self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key) | 289 self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key) |
290 | 290 |
291 def newAlert(self, msg, title, alert_type, profile): | 291 def newAlert(self, msg, title, alert_type, profile): |