Blog

Posts Tagged ‘Scripting’

Duplicate Code Finder

Friday, April 13th, 2012

We just added a plugin to identify duplicated lines of code. You can grab it at the bottom of our GUI Plugins page.

image

Update April,26 2012 – I’ve made some extensive changes to this script to improve performance and remove repeated results

New Python API

Monday, August 29th, 2011

python-logo[1]Understand now fully supports Python access to its underlying database! The new Python API allows you to write your own scripts that can create custom reports, generate your own metrics and in general make Understand deliver exactly what you want it to.

Getting Started

The Python API runs on your 3.x installation of Python, you can grab it from here if you need to install it.

Once you have Python installed you need to tell it where the Understand module is. The easiest way to do that is to add/modify the PYTHONPATH environment variable to include the module location, which is SciTools/bin/<System>/python. Also if you did not add Understand to the Path variable during installation, you will need to add the SciTools/bin/<System> directory to PATH.

Finally, to use the API you will need to put ‘import Understand’ in your script.

Documentation

The most up-to-date documentation will ship with Understand and can be accessed from the Python Console with:
   import understand
  help (understand)
A more readable version can be obtained with the python ‘pydoc’ command, which can generate an html version of the documentation. We also try to keep a current version of the Python documentation on the Manuals page.

Sample Scripts

The documentation includes some samples. More detailed example scripts are shipped with Understand in the SciTools/scripts/python folder.

Happy Scripting!