From 0ebca5d6c2a97c30f7df13c8091851438b7ed795 Mon Sep 17 00:00:00 2001 From: Owen Arnold Date: Tue, 14 May 2013 14:25:20 +0100 Subject: [PATCH] refs #7082. Port to new api. --- .../PythonAlgorithms/MergeCalFiles.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/MergeCalFiles.py b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/MergeCalFiles.py index 68715e72731e..cc2ec5f38bf8 100644 --- a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/MergeCalFiles.py +++ b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/MergeCalFiles.py @@ -4,7 +4,8 @@ *WIKI*""" -from MantidFramework import * +from mantid.api import * +from mantid.kernel import * class MergeCalFiles(PythonAlgorithm): @@ -17,22 +18,22 @@ def name(self): def PyInit(self): self.setWikiSummary("Combines the data from two [[CalFile| Cal Files]].") - self.declareFileProperty("UpdateFile","", FileAction.Load, ['cal'],Description="The cal file containing the updates to merge into another file.") - self.declareFileProperty("MasterFile","", FileAction.Load, ['cal'],Description="The master file to be altered, the file must be sorted by UDET") - self.declareFileProperty("OutputFile","", FileAction.Save, ['cal'],Description="The file to contain the results") + self.declareProperty(FileProperty("UpdateFile","", FileAction.Load, ['cal']), doc="The cal file containing the updates to merge into another file.") + self.declareProperty(FileProperty("MasterFile","", FileAction.Load, ['cal']), doc="The master file to be altered, the file must be sorted by UDET") + self.declareProperty(FileProperty("OutputFile","", FileAction.Save, ['cal']), doc="The file to contain the results") - self.declareProperty("MergeOffsets", False, Description="If True, the offsets from file1 will be merged to the master file. Default: False") - self.declareProperty("MergeSelections", False, Description="If True, the selections from file1 will be merged to the master file. Default: False") - self.declareProperty("MergeGroups", False, Description="If True, the Groups from file1 will be merged to the master file. Default: False") + self.declareProperty("MergeOffsets", False, doc="If True, the offsets from file1 will be merged to the master file. Default: False") + self.declareProperty("MergeSelections", False, doc="If True, the selections from file1 will be merged to the master file. Default: False") + self.declareProperty("MergeGroups", False, doc="If True, the Groups from file1 will be merged to the master file. Default: False") def PyExec(self): #extract settings mergeOffsets = self.getProperty("MergeOffsets") mergeSelections = self.getProperty("MergeSelections") mergeGroups = self.getProperty("MergeGroups") - updateFileName = self.getProperty("UpdateFile") - masterFileName = self.getProperty("MasterFile") - outputFileName = self.getProperty("OutputFile") + updateFileName = self.getPropertyValue("UpdateFile") + masterFileName = self.getPropertyValue("MasterFile") + outputFileName = self.getPropertyValue("OutputFile") if (mergeOffsets == False) and (mergeSelections == False) and (mergeGroups == False): raise RuntimeError('Nothing set to merge, please set one of the properties to merge, otherwise I have nothing to do') @@ -137,5 +138,4 @@ def FormatLine(self,number,UDET,offset,select,group): return line ############################################################################################# - -mtd.registerPyAlgorithm(MergeCalFiles()) +AlgorithmFactory.subscribe(MergeCalFiles())