Creating a Script

  1. Do one of the following:

  2. Click New Script on the shortcut menu. A script node appears under the node you original selected, with a default name (with .py appended) that is selected for editing.

  3. Type a file name for the script and press Enter.

  4. A  script editing window appears. Project-specific scripts are created in the scripts subdirectory of the project's directory. Global scripts are created in  root\lib\cp\plugin\proava2\scripts, where root is the directory of the ProAVA2 installation.

  5. Type Python statements in the script editing window to create your script.

  6. from enthought.logging import logger

    logger.info("string")

    logger.debug("string")

    logger.warn("string")

    logger.error("string")

    logger.critical("string")

    logger.exception("Use this in an except block.")

  7. To specify input and output parameters for your script:

    1. On the Input or Outputs tab, click Insert new item () on the table toolbar.  A row is added to the table, and an editor for the parameter appears in the Editor sub-tab.

    2. Specify settings for the parameter.

    3. Repeat steps b and c for each input or output parameter of the script.

  8. To specify metadata for the script:

    1. Click the General tab.

    2. Enter a Name and Description for the script; these values will appear in the Component Library Browser dialog box.

    3. Optionally, click Insert new item () on the Metadata table toolbar.

    4. Specify a Name and Value for the metadata item; this information is used to filter the components that appear in the Component Library Browser dialog box.

  9. Click Save to save the script.

  10. Click Cancel to close the script editing window.

 

Related Topics: