Remove chfn and chsh and allow shell changes in the gui
[public/pyceo-broken.git] / ceo / urwid / info.py
1 import urwid
2 from ceo.urwid.widgets import *
3 from ceo.urwid.window import *
4
5 class InfoPage(WizardPanel):
6     def init_widgets(self):
7         self.userid = urwid.Text("")
8         self.name = urwid.Text("")
9         self.terms = urwid.Text("")
10         self.program = urwid.Text("")
11
12         self.widgets = [
13             urwid.Text( "Member Details" ),
14             urwid.Divider(),
15             self.name,
16             self.userid,
17             self.program,
18             urwid.Divider(),
19             self.terms,
20         ]
21     def focusable(self):
22         return False
23     def activate(self):
24         member  = self.state.get('member', {})
25         name    = member.get('cn', [''])[0]
26         userid  = self.state['userid']
27         program = member.get('program', [''])[0]
28         shell   = member.get('loginShell', [''])[0]
29         terms   = member.get('term', [])
30
31         self.name.set_text("Name: %s" % name)
32         self.userid.set_text("User: %s" % userid)
33         self.program.set_text("Program: %s" % program)
34         self.program.set_text("Shell: %s" % shell)
35         self.terms.set_text("Terms: %s" % ", ".join(terms))
36     def check(self):
37         pop_window()