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