/[anoncvs]/projects/dispense2/sql-edition/servers/VendingMachine.py


UCC Code Repository

Diff of /projects/dispense2/sql-edition/servers/VendingMachine.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by dagobah, Fri Mar 2 12:33:13 2007 UTC revision 1.20 by root, Sun Jan 6 06:11:33 2008 UTC
# Line 20  class VendingException(Exception): pass Line 20  class VendingException(Exception): pass
20  class VendingMachine:  class VendingMachine:
21          def __init__(self, rfh, wfh):          def __init__(self, rfh, wfh):
22                  self.events = []                  self.events = []
23                  self.secret = 'AAAAAAAAAAAAAAAA'                  # Secret
24                    self.secret = 'SN4CKZ0RZZZZZZZZ'
25                  self.rfh = rfh                  self.rfh = rfh
26                  self.wfh = wfh                  self.wfh = wfh
27                  self.challenge = None                  self.challenge = None
# Line 38  class VendingMachine: Line 39  class VendingMachine:
39          def await_prompt(self):          def await_prompt(self):
40                  self.wfh.flush()                  self.wfh.flush()
41                  state = 1                  state = 1
42                    timeout = 0.5
43                  prefix = ''                  prefix = ''
44                  s = ''                  s = ''
45                    # mtearle - vending machine was dying wait for a response from
46                    # the hardware, suspect it was missing characters
47                    #
48                    # fixed by migration to pyserial - but future good place to start
49                  while True:                  while True:
50                          try:                          try:
51                                  s = self.rfh.read(1)                                  s = self.rfh.read(1)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.20

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26