remove passwd idler
[uccvend-vendserver.git] / sql-edition / servers / VendingMachine.py
index d7e7a8f..26dc0f2 100644 (file)
@@ -88,9 +88,9 @@ class VendingMachine:
 
        def handle_event(self, code, text):
                if code == '400':
-                       self.events.append((DOOR, 0))
-               elif code == '401':
                        self.events.append((DOOR, 1))
+               elif code == '401':
+                       self.events.append((DOOR, 0))
                elif code == '610':
                        self.events.append((SWITCH, None))
                        self.interpret_switches(text)
@@ -144,6 +144,7 @@ class VendingMachine:
        def display(self, string):
                if len(string) > 10:
                        string = string[0:10]
+               string = re.sub('(.)\.', lambda match: '.'+match.group(1), string)
                self.wfh.write('D'+string+'\n')
                (code, string) = self.get_response()
                return (code == '300', code, string)

UCC git Repository :: git.ucc.asn.au