/[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.4 by dagobah, Sun Jun 27 03:39:41 2004 UTC revision 1.6 by dagobah, Sun Jun 27 11:11:00 2004 UTC
# Line 131  class VendingMachine: Line 131  class VendingMachine:
131                          msg += '%02x'%duration                          msg += '%02x'%duration
132                  self.wfh.write(msg+'\n')                  self.wfh.write(msg+'\n')
133                  (code, string) = self.get_response()                  (code, string) = self.get_response()
134                  # FIXME: workaround a bug in rom W. should be just: return (code == '500', code, string)                  return (code == '501', code, string)
                 return (code == '500' or code == '501', code, string)  
135    
136          def display(self, string):          def display(self, string):
137                  if len(string) > 10:                  if len(string) > 10:
# Line 149  class VendingMachine: Line 148  class VendingMachine:
148                          (r, _, _) = select([self.rfh], [], [], timeout)                          (r, _, _) = select([self.rfh], [], [], timeout)
149                          if r:                          if r:
150                                  self.get_response(async = True)                                  self.get_response(async = True)
151                                    timeout = 0
152                          else:                          else:
153                                  break                                  break
154                  if len(self.events) == 0: return None                  if len(self.events) == 0: return None

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26