frontends: define the constants with classes and inheritance instance of using __builtin__
This commit is contained in:
parent
b824f9c2ce
commit
f5dd3f2265
1 changed files with 169 additions and 95 deletions
|
|
@ -25,7 +25,7 @@ from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
|
|||
from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
|
||||
from optparse import OptionParser
|
||||
|
||||
import sat_frontends.quick_frontend.constants
|
||||
from sat_frontends.quick_frontend.constants import Const
|
||||
|
||||
import gettext
|
||||
gettext.install('sat_frontend', unicode=True)
|
||||
|
|
@ -283,7 +283,7 @@ class QuickApp(object):
|
|||
self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '')
|
||||
|
||||
def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@"):
|
||||
if to_jid.startswith(const_PRIVATE_PREFIX):
|
||||
if to_jid.startswith(Const.PRIVATE_PREFIX):
|
||||
to_jid = unescapePrivate(to_jid)
|
||||
mess_type = "chat"
|
||||
self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key)
|
||||
|
|
|
|||
Loading…
Reference in a new issue