The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Private Attributes | List of all members
pts.do.command.CommandScript Class Reference

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

Public Member Functions

def __init__ (self, packagename, scriptname)
 The constructor imports the script specified through its package and script names, and obtains the signature of its do() function. More...
 
def description (self)
 This function returns the script's description, i.e. More...
 
def 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. More...
 
def name (self)
 This function returns the script's command name, i.e. More...
 

Private Attributes

 _dofunction
 
 _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__()

def 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()

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

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

the return value annotation of its do() function.

◆ doWithCommandLineArguments()

def 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()

def 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: