forked from gitter-badger/epoclive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.py
More file actions
29 lines (26 loc) · 833 Bytes
/
Copy pathinterface.py
File metadata and controls
29 lines (26 loc) · 833 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
#!/usr/amin/python
import os
import runpy
import sys
import time
import tempfile
cwd = os.getcwd()
tempdir = tempfile.gettempdir()
localtime = time.localtime(time.time())
fname = time.strftime("%Y%m%d_%H%M%S",localtime)
args = sys.argv
try:
if sys.argv.isgetdata:
while 1:
try:
runpy.run_module("src/epoc_sensor")
except:
break
os.system("killall -v gnuplot_x11")
os.system("cp %s/epoc_data %s/EPOC_%s" %(tempdir,cwd,fname))
os.remove("%s/epoc_data"%tempdir)
for foo in args.tempfiles:
os.remove(foo)
except Exception,e:
print "error executing function ..."
print "error message: %s ..."%e