Skip to content

Commit

Permalink
Refs #6101. Moved to new python api
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Jan 30, 2013
1 parent 69984d1 commit 7bfb5e5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Code/Mantid/docs/qtassistant/make_algorithms_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ def processCategories(categories, qhp, outputdir):
handle.write(le.tostring(root, pretty_print=True, xml_declaration=False))

def process(algos, qhp, outputdir):
from MantidFramework import mtd
import mantid

# sort algorithms into categories
categories = {}
for (name, versions) in algos:
alg = mtd.createAlgorithm(name, versions[-1])
for name in algos.keys():
versions = algos[name]
alg = mantid.FrameworkManager.createAlgorithm(name, versions[-1])
for category in alg.categories():
category = category.replace('\\', '/')
if not categories.has_key(category):
Expand All @@ -94,7 +95,8 @@ def process(algos, qhp, outputdir):

# sort algorithms into letter based groups
letter_groups = {}
for (name, versions) in algos:
for name in algos.keys():
versions = algos[name]
letter = str(name)[0].upper()
if not letter_groups.has_key(letter):
letter_groups[letter] = []
Expand Down Expand Up @@ -172,9 +174,11 @@ def process(algos, qhp, outputdir):
addWikiDir(helpsrcdir)

# initialize mantid
import wiki_tools
wiki_tools.initialize_Mantid(args.mantidpath)
algos = wiki_tools.get_all_algorithms(True)
if not args.mantidpath.endswith("bin"):
args.mantidpath = os.path.join(args.mantidpath, "bin")
sys.path.append(args.mantidpath)
import mantid.api
algos = mantid.api.AlgorithmFactory.getRegisteredAlgorithms(True)

# setup the qhp file
qhp = QHPFile("org.mantidproject.algorithms")
Expand Down

0 comments on commit 7bfb5e5

Please sign in to comment.