The SKIRT project
advanced radiative transfer for astrophysics
pts.do.command.CommandScript Class Reference

The CommandScript class encapsulates a particular PTS command script. More...

Public Member Functions

 __init__ (self, packagename, scriptname)
 The constructor imports the script specified through its package and script names, and obtains the signature of its do() function.
 description (self)
 This function returns the script's description, i.e.
 doWithCommandLineArguments (self, arguments=None)
 This function inspects the arguments offered by the script's do() function, retrieves the appropriate values from the corresponding command line arguments using the standard argument parser, and finally invokes the function with these arguments.
 name (self)
 This function returns the script's command name, i.e.

Protected Attributes

 _dofunction
str _name
 _signature

Detailed Description

The CommandScript class encapsulates a particular PTS command script.

It offers functions to obtain information such as the script's name and description, and to execute its do() function using the current command line arguments.#

Constructor & Destructor Documentation

◆ __init__()

pts.do.command.CommandScript.__init__ ( self,
packagename,
scriptname )

The constructor imports the script specified through its package and script names, and obtains the signature of its do() function.

Member Function Documentation

◆ description()

pts.do.command.CommandScript.description ( self)

This function returns the script's description, i.e.

the return value annotation of its do() function.

◆ doWithCommandLineArguments()

pts.do.command.CommandScript.doWithCommandLineArguments ( self,
arguments = None )

This function inspects the arguments offered by the script's do() function, retrieves the appropriate values from the corresponding command line arguments using the standard argument parser, and finally invokes the function with these arguments.

◆ name()

pts.do.command.CommandScript.name ( self)

This function returns the script's command name, i.e.

its package and script names joined by a forward slash.


The documentation for this class was generated from the following file: