forked from fsahli/music-cards
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathbox.py
executable file
·30 lines (26 loc) · 806 Bytes
/
box.py
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
#!/usr/bin/env python
#from readtest import *
import re
from CardList import CardList
from Reader import Reader
import sys
import subprocess
import os
import time
reader = Reader()
cardList = CardList()
print 'Ready: place a card on top of the reader'
while True:
card = reader.readCard()
try:
print 'Read card', card
plist = cardList.getPlaylist(card)
print 'Playlist', plist
if plist != '':
subprocess.check_call( ["./haplaylist.sh %s" % plist], shell=True)
range(10000) # some payload code
time.sleep(0.2) # sane sleep time of 0.1 seconds
except OSError as e:
print "Execution failed:"
range(10000) # some payload code
time.sleep(0.2) # sane sleep time of 0.1 seconds