Merge branch 'master' of caffeine.uwaterloo.ca:/srv/git/public/pyceo
authorMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 28 Jan 2009 05:48:18 +0000 (00:48 -0500)
committerMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 28 Jan 2009 05:48:18 +0000 (00:48 -0500)
1  2 
ceo/urwid/library.py

diff --combined ceo/urwid/library.py
@@@ -31,7 -31,6 +31,7 @@@ def search_books(data)
      """
      menu = make_menu([
          ("Overdue Books", overdue_books, None),
 +        ("Signed Out Books", outbooks_search, None),
      ])
      push_window(menu, "Book Search")
  
@@@ -53,24 -52,6 +53,24 @@@ def overdue_books(data)
  
      None
  
 +def outbooks_search(data):
 +    """
 +    Display a list of all books that are signed out.
 +    """
 +    overdue = lib.Signout.select(lib.Signout.q.indate==None)
 +
 +    widgets = []
 +
 +    for s in overdue:
 +        widgets.append(urwid.AttrWrap(ButtonText(None, s.book, str(s.book)),
 +                                      None, 'selected'))
 +        widgets.append(urwid.Divider())
 +        
 +    push_window(urwid.ListBox(widgets))
 +
 +    None
 +
 +
  def checkout_book(data):
      """
      Display the book checkout wizard.
@@@ -131,7 -112,7 +131,7 @@@ class CheckoutPage(WizardPanel)
          """
          self.state["user"] = "ERROR"
          self.state["task"] = "sign_out"
-         self.user = SingleEdit("Username: ")
+         self.user = LdapWordEdit(csclub_uri, csclub_base, 'uid', "Username: ")
          
          self.widgets = [
              urwid.Text("Book Checkout"),
@@@ -251,7 -232,7 +251,7 @@@ class CheckinPage(WizardPanel)
          self.state["book"] = None
          self.state["user"] = "ERROR"
          self.state["task"] = "sign_in"
-         self.user = SingleEdit("Username: ")
+         self.user = LdapWordEdit(csclub_uri, csclub_base, 'uid', "Username: ")
          
          self.widgets = [
              urwid.Text("Book Checkin"),