better PEP-8 compliance
This commit is contained in:
parent
ee26391a11
commit
1eeddf5900
3 changed files with 16 additions and 14 deletions
|
|
@ -446,15 +446,17 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
"""
|
||||
if data is None:
|
||||
data = dict()
|
||||
|
||||
def action_cb(data):
|
||||
if not data:
|
||||
# action was a one shot, nothing to do
|
||||
pass
|
||||
elif "xmlui" in data:
|
||||
ui = XMLUI(self, xml_data = data['xmlui'])
|
||||
ui = XMLUI(self, xml_data=data['xmlui'])
|
||||
ui.show()
|
||||
else:
|
||||
self.showPopUp(sat_widgets.Alert(_("Error"), _(u"Unmanaged action result"), ok_cb=self.removePopUp))
|
||||
|
||||
def action_eb(failure):
|
||||
self.showPopUp(sat_widgets.Alert(_("Error"), unicode(failure), ok_cb=self.removePopUp))
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
from sat.core.i18n import _
|
||||
import urwid
|
||||
from urwid_satext.sat_widgets import AdvancedEdit,Password,List,InputDialog,ConfirmDialog,Alert
|
||||
from urwid_satext.sat_widgets import AdvancedEdit, Password, List, InputDialog, ConfirmDialog, Alert
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ class ProfileManager(urwid.WidgetWrap):
|
|||
profiles.sort()
|
||||
|
||||
#login & password box must be created before list because of onProfileChange
|
||||
self.login_wid = AdvancedEdit(_('Login:'),align='center')
|
||||
self.pass_wid = Password(_('Password:'),align='center')
|
||||
self.login_wid = AdvancedEdit(_('Login:'), align='center')
|
||||
self.pass_wid = Password(_('Password:'), align='center')
|
||||
|
||||
self.list_profile = List(profiles, style=['single'], align='center', on_change=self.onProfileChange)
|
||||
|
||||
|
|
@ -107,6 +107,7 @@ class ProfileManager(urwid.WidgetWrap):
|
|||
def setJID(jabberID):
|
||||
self.login_wid.set_edit_text(jabberID)
|
||||
self.host.redraw()
|
||||
|
||||
def setPassword(password):
|
||||
self.pass_wid.set_edit_text(password)
|
||||
self.host.redraw()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
|
|||
from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
|
||||
from optparse import OptionParser
|
||||
|
||||
from sat_frontends.quick_frontend.constants import Const
|
||||
from sat_frontends.quick_frontend.constants import Const as C
|
||||
|
||||
|
||||
class QuickApp(object):
|
||||
|
|
@ -281,7 +281,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={}, callback=None, errback=None, profile_key="@NONE@"):
|
||||
if to_jid.startswith(Const.PRIVATE_PREFIX):
|
||||
if to_jid.startswith(C.PRIVATE_PREFIX):
|
||||
to_jid = unescapePrivate(to_jid)
|
||||
mess_type = "chat"
|
||||
if callback is None:
|
||||
|
|
@ -527,7 +527,7 @@ class QuickApp(object):
|
|||
|
||||
if from_jid_s == '@ALL@':
|
||||
target = '@ALL@'
|
||||
nick = Const.ALL_OCCUPANTS
|
||||
nick = C.ALL_OCCUPANTS
|
||||
else:
|
||||
from_jid = JID(from_jid_s)
|
||||
target = from_jid.bare
|
||||
|
|
|
|||
Loading…
Reference in a new issue