3f806bc72c24ac1ab5cfe5c3e5d5304210d99a50
[uccvend-vendserver.git] / sql-edition / servers / VendServer.py
1 #!/usr/bin/python
2
3 import sys, os, string, socket, time, re
4 from popen2 import popen2
5 from pyPgSQL import PgSQL
6 from LATClient import LATClient
7 from VendingMachine import VendingMachine
8
9 if __name__ == '__main__':
10         # Open vending machine via LAT
11         latclient = LATClient(service = 'VEND', password = 'dmscptd')
12         (rfh, wfh) = latclient.get_fh()
13         v = VendingMachine(rfh, wfh)
14         print 'PING is', v.ping()
15         print 'BEEP is', v.beep()
16         print 'VEND 11 is', v.vend('11')
17         print 'SILENCE is', v.silence()
18         print 'DISPLAY is', v.display('GOOD NIGHT')

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