diff --git a/Code/Mantid/Framework/Algorithms/src/CreateCalFileByNames.cpp b/Code/Mantid/Framework/Algorithms/src/CreateCalFileByNames.cpp index ff6079f89026d56f48eaef7e99d7904de690c220..f5b44fc0351ef147d82955afcbd38b0e74c9f504 100644 --- a/Code/Mantid/Framework/Algorithms/src/CreateCalFileByNames.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CreateCalFileByNames.cpp @@ -38,10 +38,10 @@ void CreateCalFileByNames::init() { new WorkspaceProperty<>("InstrumentWorkspace", "", Direction::Input, boost::make_shared<InstrumentValidator>()), "A workspace that contains a reference to the instrument of interest. " - "You can use [[LoadEmptyInstrument]] to create such a workspace."); + "You can use LoadEmptyInstrument to create such a workspace."); declareProperty( new FileProperty("GroupingFileName", "", FileProperty::Save, ".cal"), - "The name of the output [[CalFile]]"); + "The name of the output CalFile"); declareProperty( "GroupNames", "", "A string of the instrument component names to use as separate groups. " diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py index 8ccb0c77143740c9c6bf6e6f1aed3624f737c09c..3cbe75a19b62a584fdd4fd1180674ce3d7471dc2 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py @@ -49,7 +49,7 @@ class ConvertSnsRoiFileToMask(api.PythonAlgorithm): allowedInstruments = kernel.StringListValidator(INSTRUMENTS) self.declareProperty("Instrument", "", validator=allowedInstruments, - doc="One of the following instruments: "+" ".join(INSTRUMENTS)) + doc="One of the supported instruments") self.declareProperty("OutputFilePrefix", "", "Overrides the default filename for the output "\ +"file (Optional). Default is <inst_name>_Mask.") diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py index f7dedfee1e585addcdc1594fac6e49d745a867ff..3fdf7c0d4837eeb32668294db801a2cb4405c9c4 100644 --- a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py +++ b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py @@ -74,7 +74,7 @@ class PropertiesDirective(AlgorithmBaseDirective): str(direction_string[prop.direction]), property_type_dict.get(str(prop.type),str(prop.type)), str(self._get_default_prop(prop)), - str(prop.documentation.replace("\n", " ")) + self._create_property_description_string(prop) )) self.add_rst(self.make_header("Properties")) @@ -200,6 +200,43 @@ class PropertiesDirective(AlgorithmBaseDirective): return defaultstr + def _create_property_description_string(self, prop): + """ + Converts the description of the property to a more use-friendly one. + + Args: + prop. The property to find the default value of. + + Returns: + str: The string to add to the property table description section. + """ + desc = str(prop.documentation.replace("\n", " ")) + + allowedValueString = str(prop.allowedValues) + # 4 allows for [''] + if len(allowedValueString) > 4: + ##make sure the last sentence ended with a full stop (or equivalent) + if (not desc.rstrip().endswith(".")) \ + and (not desc.rstrip().endswith("!")) \ + and (not desc.rstrip().endswith("?")) \ + and (len(desc.strip())>0): + desc += "." + isFileExts = True + for item in prop.allowedValues: + #check it does not look like a file extension + if (not item.startswith(".")) and (not item[-4:].startswith(".")): + isFileExts = False + break + + prefixString = " Allowed values: " + if isFileExts: + prefixString = " Allowed extensions: " + #put a space in between entries to allow the line to break + allowedValueString = allowedValueString.replace("','","', '") + desc += prefixString + allowedValueString + + return desc + def setup(app): """