No more office/syscom entries. Check if group is valid
[public/pyceo-broken.git] / ceo / urwid / main.py
index 1fb1cd9..1fb18c9 100644 (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",
@@ -40,18 +30,6 @@ def program_name():
 
     return "%s %s %s" % (cword, eword, oword)
 
-office_data = {
-    "name" : "Office Staff",
-    "group" : "office",
-    "groups" : [ "cdrom", "audio", "video", "www" ],
-}
-
-syscom_data = {
-    "name" : "Systems Committee",
-    "group" : "syscom",
-    "groups" : [ "office", "staff", "adm", "src" ],
-}
-
 def new_member(*args, **kwargs):
     push_wizard("New Member", [
         newmember.IntroPage,
@@ -117,7 +95,7 @@ def search_members(data):
         ("Members by group", search_group, None),
         ("Back", raise_back, None),
     ])
-    push_window(menu, "Search")
+    push_window(menu, "Search Members")
 
 def search_name(data):
     push_wizard("By Name", [ search.NamePage ])
@@ -143,6 +121,13 @@ def change_shell(data):
         shell.EndPage
     ], (50, 20))
 
+def create_mysql_db(data):
+    push_wizard("Create MySQL database", [
+        databases.IntroPage,
+        databases.UserPage,
+        databases.EndPage,
+    ], (60, 15))
+
 def check_group(group):
     try:
         me = pwd.getpwuid(os.getuid()).pw_name
@@ -158,18 +143,16 @@ def top_menu():
         ("Renew Club Rep", renew_club_user, None),
         ("New Club", new_club, None),
         ("Library", library.library, None),
-        ("Databases", databases.databases, None),
     ]
     syscom_only = [
         ("Manage Club or Group Members", manage_group, None),
         ("Manage Positions", manage_positions, None),
-        ("Manage Office Staff", groups.group_members, office_data),
-        ("Manage Systems Committee", groups.group_members, syscom_data),
     ]
     unrestricted = [
         ("Display Member", display_member, None),
+        ("Search Members", search_members, None),
         ("Change Shell", change_shell, None),
-        ("Search", search_members, None),
+        ("Create MySQL database", create_mysql_db, None),
     ]
     footer = [
         ("Exit", raise_abort, None),