/[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.16 by mtearle, Tue Apr 5 09:55:01 2005 UTC revision 1.18 by dagobah, Fri Mar 2 12:33:13 2007 UTC
# Line 94  class VendingMachine: Line 94  class VendingMachine:
94                  elif code == '401':                  elif code == '401':
95                          self.events.append((DOOR, 0))                          self.events.append((DOOR, 0))
96                  elif code == '610':                  elif code == '610':
97                          self.events.append((SWITCH, None))                          # NOP this. Nothing handles this yet.
98                            #self.events.append((SWITCH, None))
99                          self.interpret_switches(text)                          self.interpret_switches(text)
100                  elif code[0] == '2':                  elif code[0] == '2':
101                          self.events.append((KEY, int(code[1:3])))                          self.events.append((KEY, int(code[1:3])))
# Line 154  class VendingMachine: Line 155  class VendingMachine:
155          def next_event(self, timeout = None):          def next_event(self, timeout = None):
156                  # we don't want to buffer in the serial port, so we get all the events                  # we don't want to buffer in the serial port, so we get all the events
157                  # we can ASAP.                  # we can ASAP.
158                    if timeout < 0: timeout = 0
159                  if len(self.events) > 0: timeout = 0                  if len(self.events) > 0: timeout = 0
160                  while True:                  while True:
161                          (r, _, _) = select([self.rfh], [], [], timeout)                          (r, _, _) = select([self.rfh], [], [], timeout)

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

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26