9 Python Components

Python components (we will use the term ``component'' here to mean regular components, data components or top-level documents) are a way to write components and/or data components using straight Python. They are useful for when the operation of the component is code-heavy and/or not terribly markup-intensive.

To call other components from within Python components, there is a function in the AE.Component module called, aptly enough, callComponent whose definition looks like this:

def callComponent (name, argDict, cache = 0,
                   defer = None, compType = DT_REGULAR)

The arguments are:

name
the path to the component (can be relative)
argDict
dictionary of arguments to the component
cache
equivalent to the cache parameter in the component tags, but see section 4.2, page for actual values to use.
compType
either the default (a regular component), AE.Component.DT_REGULAR, AE.Component.DT_DATA for a data component or AE.Component.DT_INCLUDE

The return value is either the output of the component, in the case of a regular component, or the return value of the component, in the case of a data component.


Subsections