-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckReq.py
More file actions
executable file
·31 lines (25 loc) · 797 Bytes
/
checkReq.py
File metadata and controls
executable file
·31 lines (25 loc) · 797 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
#!/dls_sw/apps/python/anaconda/1.7.0/64/bin/python
import sys
import os
from epics import caget
# Run in the data dir and it will caget on all records in the .req files and print
# out which ones time out
localFiles = [f for f in os.listdir('.') if os.path.isfile(f)]
reqFiles = list()
for x in localFiles:
if os.path.splitext(x)[1] == ".req":
if len(x.split("-")) > 2:
if x.split("-")[2] != "SIM":
reqFiles.append(x)
else:
reqFiles.append(x)
print reqFiles
for index, arg in enumerate(reqFiles):
print "Processing " + reqFiles[index]
f = open(reqFiles[index], "r")
recordString = ""
inRecord = False
for x in f:
result = str(caget(x))
if "cannot connect to" in result:
print result