From: Matt Johnston Date: Thu, 11 Aug 2005 10:51:48 +0000 (+0000) Subject: item pricing works now X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=9da23e11388f05dba1503b89f80e9c1ed50f68cb;p=zanchey%2Fdispense2.git item pricing works now --- diff --git a/sql-edition/servers/SnackConfig.py b/sql-edition/servers/SnackConfig.py index e608f81..a05f730 100755 --- a/sql-edition/servers/SnackConfig.py +++ b/sql-edition/servers/SnackConfig.py @@ -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] diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index a253f28..9792c56 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -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