forked from public/pyceo
Force redraw after status thing
This commit is contained in:
parent
5606ef01e5
commit
5c3d5e861c
|
@ -4,16 +4,6 @@ from ceo.urwid.window import *
|
||||||
from ceo.urwid import newmember, renew, info, search, positions, groups, \
|
from ceo.urwid import newmember, renew, info, search, positions, groups, \
|
||||||
shell, library, databases
|
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():
|
def program_name():
|
||||||
cwords = [ "CSC" ] * 20 + [ "Club" ] * 10 + [ "Campus" ] * 5 + \
|
cwords = [ "CSC" ] * 20 + [ "Club" ] * 10 + [ "Campus" ] * 5 + \
|
||||||
[ "Communist", "Canadian", "Celestial", "Cryptographic", "Calum's",
|
[ "Communist", "Canadian", "Celestial", "Cryptographic", "Calum's",
|
||||||
|
|
|
@ -172,7 +172,14 @@ class EndPage(WizardPanel):
|
||||||
def check(self):
|
def check(self):
|
||||||
pop_window()
|
pop_window()
|
||||||
def activate(self):
|
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...")
|
set_status("Contacting the gibson...")
|
||||||
|
|
||||||
|
redraw()
|
||||||
|
|
||||||
problem = None
|
problem = None
|
||||||
try:
|
try:
|
||||||
if self.utype == 'member':
|
if self.utype == 'member':
|
||||||
|
@ -192,6 +199,8 @@ class EndPage(WizardPanel):
|
||||||
except members.MemberException, e:
|
except members.MemberException, e:
|
||||||
problem = str(e)
|
problem = str(e)
|
||||||
|
|
||||||
|
clear_status()
|
||||||
|
|
||||||
if problem:
|
if problem:
|
||||||
self.headtext.set_text("Failures Occured Adding User")
|
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 "
|
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)
|
"If this was not expected please contact systems committee." % problem)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
set_status("Strombola Delivers")
|
||||||
self.headtext.set_text("User Added")
|
self.headtext.set_text("User Added")
|
||||||
self.midtext.set_text("Congratulations, %s has been added "
|
self.midtext.set_text("Congratulations, %s has been added "
|
||||||
"successfully. You should also rebuild the website in "
|
"successfully. You should also rebuild the website in "
|
||||||
|
|
|
@ -5,6 +5,16 @@ window_names = []
|
||||||
|
|
||||||
header = urwid.Text( "" )
|
header = urwid.Text( "" )
|
||||||
footer = 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 )
|
top = urwid.Frame( urwid.SolidFill(), header, footer )
|
||||||
|
|
||||||
def push_window( frame, name=None ):
|
def push_window( frame, name=None ):
|
||||||
|
@ -44,12 +54,16 @@ def raise_abort(*args, **kwargs):
|
||||||
def raise_back(*args, **kwarg):
|
def raise_back(*args, **kwarg):
|
||||||
raise Back()
|
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):
|
def event_loop(ui):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
cols, rows = ui.get_cols_rows()
|
cols, rows = redraw()
|
||||||
canvas = top.render( (cols, rows), focus=True )
|
|
||||||
ui.draw_screen( (cols, rows), canvas )
|
|
||||||
|
|
||||||
keys = ui.get_input()
|
keys = ui.get_input()
|
||||||
for k in keys:
|
for k in keys:
|
||||||
|
|
Loading…
Reference in New Issue