Skip to content

Commit

Permalink
Fix full path handling properly
Browse files Browse the repository at this point in the history
Refs #18843
  • Loading branch information
martyngigg committed Feb 22, 2017
1 parent 41f8add commit 6c508da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
Expand Up @@ -158,9 +158,10 @@ def validateInputs(self):
issues = {}

# Validate run number ranges
run_str = self.getProperty(RUN_PROP).value
user_input = self.getProperty(RUN_PROP).value
run_str = os.path.basename(user_input)
# String could be a full file path
if "-" in os.path.basename(run_str):
if "-" in run_str:
lower, upper = run_str.split("-")
issues = self._validate_range_formatting(lower, upper, RUN_PROP, issues)

Expand Down Expand Up @@ -685,17 +686,19 @@ def _get_runs(self):
"""
Returns the runs as a list of strings
"""
run_str = self.getProperty(RUN_PROP).value
# String could be a full file path
user_input = self.getProperty(RUN_PROP).value
run_str = os.path.basename(user_input)
# Load is not doing the right thing when summing. The numbers don't look correct
if "-" in run_str:
lower, upper = run_str.split("-")
# Range goes lower to up-1 but we want to include the last number
runs = list(range(int(lower), int(upper)+1))

elif "," in run_str:
runs = run_str.split(",")
else:
runs = [run_str]
# Leave it as it is
runs = [user_input]

return runs

Expand Down

0 comments on commit 6c508da

Please sign in to comment.