7.12 Defining the Run method for usecase 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-7 Examples

$Run$ mainMethod
def mainMethod(options):
    print "Running the main method"
It is possible to define an entry point to the usecase 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-8 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 usecase script is run.
Non-ConfidentialPDF file icon PDF versionARM DUI0446W
Copyright © 2010-2015 ARM. All rights reserved.