7.13 Defining the Run method for use case scripts

The method named in the $Run$ tag must have at least one parameter, called options, which provides access to the script options.

Example 7-8 Examples

...
$Run$ mainMethod
...
def mainMethod(options):
    print "Running the main method"

It is possible to define an entry point to the use case that requires more than one parameter. The definition of the $Run$ tag only defines the function name. The definition of the function within the script defines how many parameters are needed.

Example 7-9 Examples

...
$Run$ main
...
# main method with positional arguments
def main(options, filename, value):
    print "Running the main method"
    # Using the positional arguments supplied to the script.
    print "Using file: " + filename + " and value: " + value

In this example main requires two parameters, filename and value which must be supplied on the command-line when the use case script is run.

Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.