Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_app.py @ 1019:6a16ec17a458
better PEP-8 compliance
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 07 May 2014 15:44:31 +0200 |
parents | d1084f7e56a5 |
children | 5197600a1e13 |
comparison
equal
deleted
inserted
replaced
1018:e22e4cf86204 | 1019:6a16ec17a458 |
---|---|
25 from sat_frontends.bridge.DBus import DBusBridgeFrontend | 25 from sat_frontends.bridge.DBus import DBusBridgeFrontend |
26 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError | 26 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError |
27 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate | 27 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate |
28 from optparse import OptionParser | 28 from optparse import OptionParser |
29 | 29 |
30 from sat_frontends.quick_frontend.constants import Const | 30 from sat_frontends.quick_frontend.constants import Const as C |
31 | 31 |
32 | 32 |
33 class QuickApp(object): | 33 class QuickApp(object): |
34 """This class contain the main methods needed for the frontend""" | 34 """This class contain the main methods needed for the frontend""" |
35 | 35 |
279 | 279 |
280 timestamp = extra.get('archive') | 280 timestamp = extra.get('archive') |
281 self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') | 281 self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') |
282 | 282 |
283 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, callback=None, errback=None, profile_key="@NONE@"): | 283 def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, callback=None, errback=None, profile_key="@NONE@"): |
284 if to_jid.startswith(Const.PRIVATE_PREFIX): | 284 if to_jid.startswith(C.PRIVATE_PREFIX): |
285 to_jid = unescapePrivate(to_jid) | 285 to_jid = unescapePrivate(to_jid) |
286 mess_type = "chat" | 286 mess_type = "chat" |
287 if callback is None: | 287 if callback is None: |
288 callback = lambda: None | 288 callback = lambda: None |
289 if errback is None: | 289 if errback is None: |
525 if not self.check_profile(profile): | 525 if not self.check_profile(profile): |
526 return | 526 return |
527 | 527 |
528 if from_jid_s == '@ALL@': | 528 if from_jid_s == '@ALL@': |
529 target = '@ALL@' | 529 target = '@ALL@' |
530 nick = Const.ALL_OCCUPANTS | 530 nick = C.ALL_OCCUPANTS |
531 else: | 531 else: |
532 from_jid = JID(from_jid_s) | 532 from_jid = JID(from_jid_s) |
533 target = from_jid.bare | 533 target = from_jid.bare |
534 nick = from_jid.resource | 534 nick = from_jid.resource |
535 | 535 |