Force redraw after status thing

This commit is contained in:
Michael Spang 2009-09-16 18:03:04 -04:00
parent 5606ef01e5
commit 5c3d5e861c
3 changed files with 27 additions and 13 deletions

View File

@ -4,16 +4,6 @@ from ceo.urwid.window import *
from ceo.urwid import newmember, renew, info, search, positions, groups, \
shell, library, databases
ui = urwid.curses_display.Screen()
ui.register_palette([
# name, foreground, background, mono
('banner', 'light gray', 'default', None),
('menu', 'light gray', 'default', 'bold'),
('selected', 'black', 'light gray', 'bold'),
])
def program_name():
cwords = [ "CSC" ] * 20 + [ "Club" ] * 10 + [ "Campus" ] * 5 + \
[ "Communist", "Canadian", "Celestial", "Cryptographic", "Calum's",

View File

@ -172,7 +172,14 @@ class EndPage(WizardPanel):
def check(self):
pop_window()
def activate(self):
self.headtext.set_text("Adding %s" % self.state['userid'])
self.midtext.set_text("Please be patient while the user is added. "
"If more than a few seconds pass, check for a "
"phase variance and try inverting the polarity.")
set_status("Contacting the gibson...")
redraw()
problem = None
try:
if self.utype == 'member':
@ -192,6 +199,8 @@ class EndPage(WizardPanel):
except members.MemberException, e:
problem = str(e)
clear_status()
if problem:
self.headtext.set_text("Failures Occured Adding User")
self.midtext.set_text("The error was:\n\n%s\n\nThe account may be partially added "
@ -199,6 +208,7 @@ class EndPage(WizardPanel):
"If this was not expected please contact systems committee." % problem)
return
else:
set_status("Strombola Delivers")
self.headtext.set_text("User Added")
self.midtext.set_text("Congratulations, %s has been added "
"successfully. You should also rebuild the website in "

View File

@ -5,6 +5,16 @@ window_names = []
header = urwid.Text( "" )
footer = urwid.Text( "" )
ui = urwid.curses_display.Screen()
ui.register_palette([
# name, foreground, background, mono
('banner', 'light gray', 'default', None),
('menu', 'light gray', 'default', 'bold'),
('selected', 'black', 'light gray', 'bold'),
])
top = urwid.Frame( urwid.SolidFill(), header, footer )
def push_window( frame, name=None ):
@ -44,12 +54,16 @@ def raise_abort(*args, **kwargs):
def raise_back(*args, **kwarg):
raise Back()
def redraw():
cols, rows = ui.get_cols_rows()
canvas = top.render( (cols, rows), focus=True )
ui.draw_screen( (cols, rows), canvas )
return cols, rows
def event_loop(ui):
while True:
try:
cols, rows = ui.get_cols_rows()
canvas = top.render( (cols, rows), focus=True )
ui.draw_screen( (cols, rows), canvas )
cols, rows = redraw()
keys = ui.get_input()
for k in keys: