Skip to content

Commit

Permalink
refs #6601. Automated screen capture script.
Browse files Browse the repository at this point in the history
Script that will find all the registered algorithms and generate a screenshot of each.
  • Loading branch information
OwenArnold committed Feb 22, 2013
1 parent 522627f commit 0734c20
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions Code/Mantid/scripts/WikiMaker/ScreenshotAlgDialogs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import mantidqtpython
import os
import tempfile
from mantidplotpy.proxies import threadsafe_call

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

"""
Take a screenshot of the algorithm dialog associated with the algorithmDeprecationMessage
@param alg_name : Name of the algorithm to create the dialog for
"""
def screenShotAlgorithm(alg_name):
interface_manager = mantidqtpython.MantidQt.API.InterfaceManager()
dlg = threadsafe_call( interface_manager.createDialogFromName, alg_name, True)
file = alg_name + "_dlg"
screenshot(widget=dlg, filename=file, screenshot_dir=screenshotdir)
threadsafe_call(dlg.close)
file_abs = os.path.join(screenshotdir, file + ".png")

"""
Screenshot all registered algorithms.
"""
def screenShotAll():
include_hidden_algorithms = True
algs = AlgorithmFactory.getRegisteredAlgorithms(include_hidden_algorithms)
for alg_name, versions in algs.iteritems():
if specialization_exists(name):
continue
try:
screenShotAlgorithm(alg_name)
except Exception:
print "Failed to generate dialog for " + alg_name
continue

#Execute the
screenShotAll();








0 comments on commit 0734c20

Please sign in to comment.