item pricing works now
authorMatt Johnston <matt@ucc.gu.uwa.edu.au>
Thu, 11 Aug 2005 10:51:48 +0000 (10:51 +0000)
committerMatt Johnston <matt@ucc.gu.uwa.edu.au>
Thu, 11 Aug 2005 10:51:48 +0000 (10:51 +0000)
sql-edition/servers/SnackConfig.py
sql-edition/servers/VendServer.py

index e608f81..a05f730 100755 (executable)
@@ -2,7 +2,7 @@
 
 class VendingException( Exception ): pass
 
-FILENAME="snacks.conf"
+FILENAME="/etc/dispense/snacks.conf"
 
 def parse_line( l ):
        toks = l.strip().split()
@@ -54,7 +54,7 @@ def get_snacks( filename = FILENAME ):
 def get_snack( slot ):
        
        snacks = get_snacks()
-       if slot not in key:
+       if slot not in snacks:
                raise VendingException( "Slot '%s' isn't in config file" % slot )
        
        return snacks[slot]
index a253f28..9792c56 100755 (executable)
@@ -17,6 +17,7 @@ from MessageKeeper import MessageKeeper
 from HorizScroll import HorizScroll
 from random import random, seed
 from Idler import GreetingIdler,TrainIdler,GrayIdler,StringIdler,ClockIdler,FortuneIdler,FileIdler,PipeIdler
+from SnackConfig import get_snacks, get_snack
 import socket
 from posix import geteuid
 

UCC git Repository :: git.ucc.asn.au