Mercurial > libervia-backend
comparison frontends/src/primitivus/profile_manager.py @ 1019:6a16ec17a458
better PEP-8 compliance
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 07 May 2014 15:44:31 +0200 |
parents | 73a0b7f94674 |
children | 5197600a1e13 |
comparison
equal
deleted
inserted
replaced
1018:e22e4cf86204 | 1019:6a16ec17a458 |
---|---|
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 from sat.core.i18n import _ | 20 from sat.core.i18n import _ |
21 import urwid | 21 import urwid |
22 from urwid_satext.sat_widgets import AdvancedEdit,Password,List,InputDialog,ConfirmDialog,Alert | 22 from urwid_satext.sat_widgets import AdvancedEdit, Password, List, InputDialog, ConfirmDialog, Alert |
23 from sat.tools.jid import JID | 23 from sat.tools.jid import JID |
24 | 24 |
25 | 25 |
26 class ProfileManager(urwid.WidgetWrap): | 26 class ProfileManager(urwid.WidgetWrap): |
27 | 27 |
30 #profiles list | 30 #profiles list |
31 profiles = self.host.bridge.getProfilesList() | 31 profiles = self.host.bridge.getProfilesList() |
32 profiles.sort() | 32 profiles.sort() |
33 | 33 |
34 #login & password box must be created before list because of onProfileChange | 34 #login & password box must be created before list because of onProfileChange |
35 self.login_wid = AdvancedEdit(_('Login:'),align='center') | 35 self.login_wid = AdvancedEdit(_('Login:'), align='center') |
36 self.pass_wid = Password(_('Password:'),align='center') | 36 self.pass_wid = Password(_('Password:'), align='center') |
37 | 37 |
38 self.list_profile = List(profiles, style=['single'], align='center', on_change=self.onProfileChange) | 38 self.list_profile = List(profiles, style=['single'], align='center', on_change=self.onProfileChange) |
39 | 39 |
40 #new & delete buttons | 40 #new & delete buttons |
41 buttons = [urwid.Button(_("New"), self.onNewProfile), | 41 buttons = [urwid.Button(_("New"), self.onNewProfile), |
105 | 105 |
106 def onProfileChange(self, list_wid): | 106 def onProfileChange(self, list_wid): |
107 def setJID(jabberID): | 107 def setJID(jabberID): |
108 self.login_wid.set_edit_text(jabberID) | 108 self.login_wid.set_edit_text(jabberID) |
109 self.host.redraw() | 109 self.host.redraw() |
110 | |
110 def setPassword(password): | 111 def setPassword(password): |
111 self.pass_wid.set_edit_text(password) | 112 self.pass_wid.set_edit_text(password) |
112 self.host.redraw() | 113 self.host.redraw() |
113 | 114 |
114 profile_name = list_wid.getSelectedValue() | 115 profile_name = list_wid.getSelectedValue() |