Skip to content

Commit

Permalink
refs #6601. Use Env var.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Feb 22, 2013
1 parent 0734c20 commit 4459f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Code/Mantid/MantidPlot/mantidplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,16 @@ def __doSliceViewer(wsname, label="", xydim=None, slicepoint=None,
def get_screenshot_dir():
""" Returns the directory for screenshots,
or NONE if not set """
dest = os.getenv('MANTID_SCREENSHOT_REPORT')
expected_env_var = 'MANTID_SCREENSHOT_REPORT'
dest = os.getenv(expected_env_var)
if not dest is None:
# Create the report directory if needed
if not os.path.exists(dest):
os.mkdir(dest)
else:
errormsg = "The expected environmental does not exist: " + expected_env_var
print errormsg
raise RuntimeError(errormsg)
return dest


Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/WikiMaker/ScreenshotAlgDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from mantidplotpy.proxies import threadsafe_call

# Where to save the screenshots.
screenshotdir = tempfile.gettempdir();
screenshotdir = get_screenshot_dir()
print "Writing screenshots to " + screenshotdir

"""
Expand Down

0 comments on commit 4459f5e

Please sign in to comment.