From 9da23e11388f05dba1503b89f80e9c1ed50f68cb Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 11 Aug 2005 10:51:48 +0000 Subject: [PATCH] item pricing works now --- sql-edition/servers/SnackConfig.py | 4 ++-- sql-edition/servers/VendServer.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 -- 2.20.1