Changeset 110

Show
Ignore:
Timestamp:
04/12/08 23:00:39 (5 months ago)
Author:
njriley
Message:

log unexpected exceptions; fix comments

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sucrose/trunk/python/keypad_tk.py

    r107 r110  
    3535 
    3636                self.window = Tkinter.Tk() 
     37                self.window.title('Sucrose') 
    3738                self.window.geometry('800x600+0+0') 
    3839                self.window.resizable(False, False) 
     
    151152                                                  font=("helvetica", 24), bg='white') 
    152153                        val_label.grid(row=row + 1, column=1, sticky=Tkinter.EW) 
    153                          
     154 
    154155                        setattr(self, attr, val_label) 
    155156 
    156                 # self.config(width=self.parent. 
    157  
    158157class Keypad(Tkinter.Frame): 
    159158        def update(self, tray): 
    160159                self.tray = tray 
     160                # If it's not a valid purchase, don't allow the user to press 
     161                # the vend button 
    161162                if not tray: 
    162163                        self.item = None 
     
    187188                        tray = self.sucrose.tray_from_location(self.item_location) 
    188189 
    189                 # If it's not a valid purchase, don't allow the user to press 
    190                 # the vend button 
    191                 except Exception, e: 
     190                except ValueError, e: 
     191                        self.location.config(text=self.item_location) 
     192                        self.name.config(text=str(e), fg='red') 
     193                        tray = None 
     194                except: 
     195                        import traceback; traceback.print_exc() 
    192196                        self.location.config(text=self.item_location) 
    193197                        self.name.config(text=str(e), fg='red')