-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #6601. Automated screen capture script.
Script that will find all the registered algorithms and generate a screenshot of each.
- Loading branch information
1 parent
522627f
commit 0734c20
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|