Skip to content
Snippets Groups Projects
Commit 1fcc12b1 authored by Nick Draper's avatar Nick Draper
Browse files

Merge branch '28275_workbench_plot_dialog_validation' of...

Merge branch '28275_workbench_plot_dialog_validation' of https://github.com/mantidproject/mantid into 28275_workbench_plot_dialog_validation
parents 3610127c c3097986
No related branches found
No related tags found
No related merge requests found
......@@ -162,7 +162,7 @@ class SpectraSelectionDialog(SpectraSelectionDialogUIBase):
first = last = item
# the last range ended by iteration end
ranges.append("{0}{1}{2}".format(first, RANGE_SPECIFIER, last) if last > first else "{0}".format(first))
return ','.join(ranges)
return ', '.join(ranges)
def _setup_connections(self):
ui = self._ui
......@@ -227,7 +227,7 @@ class SpectraSelectionDialog(SpectraSelectionDialogUIBase):
self.selection = selection
def _parse_spec_nums(self):
spec_nums = parse_selection_str(self._ui.specNums.text(), allowed_values = self._plottable_spectra)
spec_nums = parse_selection_str(self._ui.specNums.text(), allowed_values=self._plottable_spectra)
if spec_nums:
selection = SpectraSelection(self._workspaces)
selection.spectra = spec_nums
......@@ -240,7 +240,7 @@ class SpectraSelectionDialog(SpectraSelectionDialogUIBase):
return self.selection is not None
def parse_selection_str(txt, min_val = None, max_val = None, allowed_values = None):
def parse_selection_str(txt, min_val=None, max_val=None, allowed_values=None):
"""Parse an input string containing plot index selection.
:param txt: A single line of text containing a comma-separated list of values or range of values, i.e.
......@@ -264,7 +264,7 @@ def parse_selection_str(txt, min_val = None, max_val = None, allowed_values = No
def is_in_range(val):
if allowed_values is not None:
return (val in allowed_values)
return val in allowed_values
else:
return min_val <= val <= max_val
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment