Skip to content

Commit

Permalink
Sweep up some references to old algorithms dir key.
Browse files Browse the repository at this point in the history
Refs #970
  • Loading branch information
martyngigg committed Apr 18, 2013
1 parent f400475 commit 1835835
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Code/Mantid/Framework/PythonAPI/MantidFramework.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def initialise(self, gui=None):

_mantidsimple.mockup(dir_list)
pyalg_loader = PyAlgLoader()
plugins = pyalg_loader.load_modules(refresh=False)
plugins = pyalg_loader.load_modules(dir_list, refresh=False)
new_attrs = _mantidsimple.translate() # Make sure the PythonAlgorithm functions are written
_sync_attrs(_mantidsimple, new_attrs,plugins)

Expand Down Expand Up @@ -1424,11 +1424,10 @@ class PyAlgLoader(object):

__CHECKLINES__ = 100

def load_modules(self, refresh=False):
def load_modules(self, dir_list, refresh=False):
"""
Import Python modules containing Python algorithms
"""
dir_list = mtd.getConfigProperty("pythonalgorithms.directories").split(';')
if len(dir_list) == 0:
mtd.sendLogMessage('PyAlgLoader.load_modules: no python algorithm directory found')
return
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/PythonAPI/test/MantidSimpleTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TemporaryPythonAlgorithm(object):
an removes the file in the del method
"""
def __init__(self, name, code):
plugin_dirs = mantidsimple.mtd.settings['pythonalgorithms.directories'].split(";")
plugin_dirs = mantidsimple.mtd.settings['python.plugins.directories'].split(";")
if len(plugin_dirs) == 0:
raise RuntimeError("No Python algorithm directories defined")

Expand Down Expand Up @@ -115,7 +115,7 @@ def PyExec(self):
cmd = sys.executable + ' -c "from MantidFramework import *;mtd.initialise();from mantidsimple import %(name)s;%(name)s()"' % {'name':name1}
try:
subprocess.check_call(cmd,shell=True)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError,exc:
self.fail("Error occurred running one Python algorithm from another: %s" % str(exc))

# Ensure the files are removed promptly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TemporaryPythonAlgorithm(object):
def __init__(self, name, code):
from mantid import config

plugin_dirs = config['pythonalgorithms.directories'].split(";")
plugin_dirs = config['python.plugins.directories'].split(";")
if len(plugin_dirs) == 0:
raise RuntimeError("No Python algorithm directories defined")

Expand Down

0 comments on commit 1835835

Please sign in to comment.