Closedown

This commit is contained in:
x07maop
2015-06-30 09:52:16 +02:00
parent 42826f070d
commit d8f5d2b2eb

View File

@@ -33,6 +33,8 @@ start = time.localtime()
folder = os.path.expanduser("~/Data1/") + FOLDER + "/";
def getNewestFile():
global folder
import glob
try:
return max(glob.iglob(folder+'/*.txt'), key=os.path.getctime)
except:
@@ -79,15 +81,20 @@ print "Finished Energy scan"
#File convertion
#newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
name = caget("MSG").split(' ')[0]
newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
#name = caget("MSG").split(' ')[0]
name = getNewestFile()
print "Newest was" + str(newest)
print "Now is" + str(name)
print "MSG = " + caget("MSG")
if name == newest:
raise Exception("Data file not created")
if not os.path.isfile(name):
raise Exception("Data file not found: " + name)
cmd = "/sls/X07MA/data/x07maop/bin/modify_otf.pl " + name + " " + newName;
print("Converting data file: " + cmd);
import os