forked from eighthave/MPOST_Linux_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmpost_test.py
More file actions
40 lines (37 loc) · 928 Bytes
/
mpost_test.py
File metadata and controls
40 lines (37 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
import time
import glob
import mpost
acceptors = []
for f in glob.glob('/dev/loc-bill-ttyUSB*'):
m = mpost.CAcceptor()
m.open(f, mpost.powerup.A)
# sleep after opening since it can take a while to get
time.sleep(5)
print 'm.devicestate: ',
print m.devicestate
m.autostack = True
m.acceptbills = True
acceptors.append(m)
print "device: "
print m.deviceportname
print m.devicemodel
# print m.devicetype
print m.devicerevision
print 'm.bill: ',
print m.bill
print 'm.billtypes: ',
print m.billtypes
print 'm.billvalues: '
setbillvalues = []
for bill in m.billvalues:
if bill[0] != 'USD' or bill[0] != 'RUB':
setbillvalues.append(bill)
print bill[0]
else:
print 'NOT: ',
print bill
m.autostack = False
m.acceptbills = False
time.sleep(6)
m.close()