Script execution

This commit is contained in:
x07maop
2015-06-23 14:29:37 +02:00
parent cd4ad4b033
commit a2accf3a25

View File

@@ -31,6 +31,14 @@ print E1,E2,TIME,DELAY,MODE ,OFFSET ,FOLDER ,FILE ,ALPHA
start = time.localtime()
folder = os.path.expanduser("~/Data1/") + FOLDER + "/";
def getNewestFile():
try:
return max(glob.iglob(folder+'/*.tsxt'), key=os.path.getctime)
except:
return None
newest = getNewestFile()
def wait_channel(name, value, type):
print "Waiting " + str(name) + " = " + str(value)
cawait(name, value, type = type)
@@ -68,13 +76,20 @@ print "Finished Energy scan"
cmd = "/sls/X07MA/data/x07maop/bin/modify_otf.pl "
folder = "~/Data1/" + FOLDER + "/";
name = caget("MSG").split(' ')[0]
if name == "Welcome":
name = caget("MSG").split(' ')[0]
name = folder + name;
#name = caget("MSG").split(' ')[0]
#name = folder + name;
newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
name = getNewestFile()
if name == newest:
raise Exception("Data file not created")
if not os.path.isfile(name):
raise Exception("Data file not found: " + name)
cmd = cmd + name + " " + newName;
print("Converting data file: " + cmd);
import os