Skip to content

Commit

Permalink
refs #7108. Fix system tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed May 16, 2013
1 parent 5246d67 commit 257c256
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def name(self):
return "ConjoinFiles"

def __load(self, directory, instr, run, loader, exts, wksp):
filename = None
for ext in exts:
filename = "%s_%s%s" % (instr, str(run), ext)
if len(directory) > 0:
Expand All @@ -25,11 +26,12 @@ def __load(self, directory, instr, run, loader, exts, wksp):
continue
try:
self.log().information("Trying to load '%s'" % filename)
loader(filename, wksp)
loader(Filename=filename, OutputWorkspace=wksp)
return
except Exception, e:
logger.information(str(e))
pass
raise RuntimeError("Failed to load run %s" % str(run))
raise RuntimeError("Failed to load run %s from file %s" % (str(run), filename))

def PyInit(self):
greaterThanZero = IntArrayBoundedValidator()
Expand All @@ -44,7 +46,7 @@ def PyExec(self):
runs = self.getProperty("RunNumbers")
instr = config.getInstrument().shortName()
directory = self.getPropertyValue("Directory").strip()

# change here if you want something other than gsas files
exts = ['.txt', '.gsa']
loader = LoadGSS
Expand All @@ -59,7 +61,8 @@ def PyExec(self):
else:
self.__load(directory, instr, run, loader, exts, run)
ConjoinWorkspaces(InputWorkspace1=wksp, InputWorkspace2=run, CheckOverlapping=False)
DeleteWorkspace(run)
if mtd.doesExist(run):
DeleteWorkspace(run)

self.setProperty("OutputWorkspace", mtd[wksp])

Expand Down

0 comments on commit 257c256

Please sign in to comment.