self.vstatus.time_to_autologout = None
self.vstatus.mk.set_message('PRICECHECK')
sleep(0.5)
- self.scroll_options('', vstatus.mk)
+ self.scroll_options('', self.vstatus.mk)
self.vstatus.change_state(STATE_GET_SELECTION)
return
try:
self.vstatus.cur_user = get_uid(card_id)
- logging.info('Mapped card id to uid %s'%vstatus.cur_user)
- self.vstatus.username = get_uname(vstatus.cur_user)
+ logging.info('Mapped card id to uid %s'%self.vstatus.cur_user)
+ self.vstatus.username = get_uname(self.vstatus.cur_user)
if self.acct_is_disabled(self.vstatus.username):
self.vstatus.username = '-disabled-'
except ValueError:
except ValueError:
pass
- logging.info('Enrolling card %s to uid %s (%s)'%(card_id, vstatus.cur_user, vstatus.username))
- self.set_card_id(self.vstatus.cur_user, card_id)
+ logging.info('Enrolling card %s to uid %s (%s)'%(card_id, self.vstatus.cur_user, self.vstatus.username))
+ self.set_card_id(self.vstatus.cur_user, self.card_id)
self.vstatus.mk.set_messages(
[(self.center('CARD'), False, 0.5),
(self.center('ENROLLED'), False, 0.5)])
logging.info('Connecting to vending machine using LAT')
latclient = LATClient(service = cf.ServiceName, password = cf.ServicePassword, server_name = cf.ServerName, connect_password = cf.ConnectPassword, priv_password = cf.PrivPassword)
rfh, wfh = latclient.get_fh()
- #elif options.use_serial:
- # # Open vending machine via serial.
- # logging.info('Connecting to vending machine using serial')
- # serialclient = SerialClient(port = '/dev/ttyS1', baud = 9600)
- # rfh,wfh = serialclient.get_fh()
+ elif options.use_serial:
+ # Open vending machine via serial.
+ logging.info('Connecting to vending machine using serial')
+ serialclient = SerialClient(port = '/dev/ttyS1', baud = 9600)
+ rfh,wfh = serialclient.get_fh()
else:
#(rfh, wfh) = popen2('../../virtualvend/vvend.py')
logging.info('Connecting to virtual vending machine on %s:%d'%(options.host,options.port))
from optparse import OptionParser
op = OptionParser(usage="%prog [OPTION]...")
- op.add_option('-f', '--config-file', default='./servers.conf', metavar='FILE', dest='config_file', help='use the specified config file instead of /etc/dispense/servers.conf')
+ op.add_option('-f', '--config-file', default='/etc/dispense2/servers.conf', metavar='FILE', dest='config_file', help='use the specified config file instead of /etc/dispense/servers.conf')
op.add_option('--serial', action='store_true', default=False, dest='use_serial', help='use the serial port')
op.add_option('--lat', action='store_true', default=False, dest='use_lat', help='use LAT')
op.add_option('--virtualvend', action='store_false', default=True, dest='use_serial', help='use the virtual vending server instead of LAT')