Cortex  10.0.0-a4
Files | Classes | Functions
Python functionality

Some parts of the IECore library are defined purely in Python. More...

Files

file  StringUtil.py
 This file defines useful string related functions.
 

Classes

class  IECore.Formatter
 The Formatter class defines an interface for specifying simple structured output without having to be concerned with exactly how that output is displayed. More...
 
class  IECore.WrappedTextFormatter
 Implements the Formatter interface in a very simple form, just outputting text with word wrapping to a file object. More...
 
class  IECore.OptionalCompoundParameter
 This class implements a CompoundParameter that do not validate optional parameters if they are undefined. More...
 
class  IECore.MenuItemDefinition
 The MenuItemDefinition class defines the contents of a menu item for use with the MenuDefinition class. More...
 
class  IECore.MenuDefinition
 The MenuDefinition class defines the contents of a hierarchical menu containing MenuItemDefinition instances. More...
 
class  IECore.ParameterParser
 This class defines a means of parsing a list of string arguments with respect to a Parameter definition. More...
 
class  IECore.CapturingMessageHandler
 The CapturingMessageHandler simply stores all messages passed to it in an attribute called messages. More...
 
class  IECore.CompoundVectorParameter
 This class is a CompoundParameter that only accepts vector parameters with the same length. More...
 

Functions

def IECore.setLogLevelByName (levelName)
 Set the environment variable and the current LevelFilteredMessageHandler. More...
 
def IECore.setLogLevel (level)
 Set the environment variable and the current LevelFilteredMessageHandler. More...
 
def IECore.showCallStack ()
 Help function to track dificult errors. More...
 
def IECore.exceptionInfo ()
 Use this function to get information about the context where the exception happened. More...
 
def IECore.debugException (args)
 Sends debug messages to the current message handler and appends a full description of the catched exception. More...
 
def IECore.debug (args)
 Sends debug messages to the current message handler. More...
 
def IECore.warning (args)
 
def IECore.info (args)
 
def IECore.error (args)
 
def IECore.isSimpleDataType (obj)
 Utility function that recognizes objects that are simple types. More...
 
def IECore.isSimpleNumericDataType (obj)
 Utility function that recognizes objects that are numeric simple types. More...
 
def IECore.isMatrixDataType (obj)
 Utility function that recognizes objects that hold values as matrices. More...
 
def IECore.isMappingDataType (obj)
 Utility function that returns True if a Data object obj could be created with a dict.
 
def IECore.isSequenceDataType (obj)
 Utility function that returns True if a Data object obj could be created from a list.
 
def IECore.getDataDerivedTypes ()
 Function that returns a list of Data derived classes.
 
def IECore.elementTypeFromDataType (dataType)
 Returns the type (class) for the element type hold on the instances of the given Data type. More...
 
def IECore.valueTypeFromSequenceType (sequenceType)
 Returns the type (class) used on each indexed value on the given sequence type. More...
 
def IECore.dataTypeFromElementType (elementType)
 Returns the Data class that is instantiable given an element type.
 
def IECore.dataTypeFromElement (element)
 Returns the Data class that is instantiable given a element data object. More...
 
def IECore.dataFromElement (element)
 Factory function for Data objects given its element data. More...
 
def IECore.mv (sequence1, sequence2)
 Moves the set of files specified by sequence1 to the set of files specified by sequence2, where sequence1 and sequence2 are FileSequence objects of equal length. More...
 
def IECore.cp (sequence1, sequence2)
 Copies the set of files specified by sequence1 to the set of files specified by sequence2, where sequence1 and sequence2 are FileSequence objects of equal length. More...
 
def IECore.rm (sequence)
 Removes all the files specified by the sequence.
 
def IECore.cat (sequence)
 Concetenates all the files specified by the sequence to stdout. More...
 
def IECore.formatParameterHelp (parm, formatter)
 This function formats helpful descriptions of parameters, using a Formatter object.
 
def IECore.loadConfig
 This function provides an easy means of providing a flexible configuration mechanism for any software. More...
 

Detailed Description

Some parts of the IECore library are defined purely in Python.

These are shown below.

Function Documentation

def IECore.cat (   sequence)

Concetenates all the files specified by the sequence to stdout.

Todo:
Allow destination file to be specified

Referenced by IECore.ClassLoader.defaultProceduralLoader().

def IECore.cp (   sequence1,
  sequence2 
)

Copies the set of files specified by sequence1 to the set of files specified by sequence2, where sequence1 and sequence2 are FileSequence objects of equal length.

This function is safe even if the files specified by each sequence overlap.

Referenced by IECore.ClassLoader.defaultProceduralLoader().

def IECore.dataFromElement (   element)

Factory function for Data objects given its element data.

Parameters: obj - any IECore simple structure objects (Color3f, V3f, ...) or python simple types (int, str, list, dict...) Returns: A Data object that holds the given element data object.

References IECore.dataTypeFromElement().

def IECore.dataTypeFromElement (   element)

Returns the Data class that is instantiable given a element data object.

It also instantiate container Data objects, like VectorData and CompoundData, given the proper list and dict.

References IECore.dataTypeFromElementType().

Referenced by IECore.dataFromElement().

def IECore.debug (   args)

Sends debug messages to the current message handler.

Every message include information about the module and line number from where this function was called. Parameters: Any string or object. They are converted to string and separated by space.

Referenced by IECore.setLogLevel().

def IECore.debugException (   args)

Sends debug messages to the current message handler and appends a full description of the catched exception.

Parameters: Any string or object. They are converted to string and separated by space.

def IECore.elementTypeFromDataType (   dataType)

Returns the type (class) for the element type hold on the instances of the given Data type.

In fact, returns the class that is used to instantiate the Data type. For example, if the Data class returns true from isSequenceType(), then this function returns the type 'list'. See also: valueTypeFromSequenceType()

def IECore.exceptionInfo ( )

Use this function to get information about the context where the exception happened.

Returns a tuple of strings (location, stack trace) for the captured exception.

def IECore.isMatrixDataType (   obj)

Utility function that recognizes objects that hold values as matrices.

For example the IMath types: V2f, M33f, Color3f. But not vectors of those types.

def IECore.isSimpleDataType (   obj)

Utility function that recognizes objects that are simple types.

That means, have one single value on it and are not IMath data types. VectorData, CompoundData and IMath-type Data are not simple. Returns a boolean indicating if the given object is a simple Data.

def IECore.isSimpleNumericDataType (   obj)

Utility function that recognizes objects that are numeric simple types.

That means, have one single value on it, and it is numeric. For example, IntData. But not IntVectorData, nor CharData which just accepts characters (up to now).

def IECore.loadConfig (   searchPaths,
  contextDict,
  raiseExceptions = False,
  subdirectory = "" 
)

This function provides an easy means of providing a flexible configuration mechanism for any software.

It works by executing all .py files found on a series of searchpaths. It is expected that these files will then make appropriate calls to objects passed in via the specified contextDict.

def IECore.mv (   sequence1,
  sequence2 
)

Moves the set of files specified by sequence1 to the set of files specified by sequence2, where sequence1 and sequence2 are FileSequence objects of equal length.

This function is safe even if the files specified by each sequence overlap.

Referenced by IECore.ClassLoader.defaultProceduralLoader().

def IECore.setLogLevel (   level)

Set the environment variable and the current LevelFilteredMessageHandler.

Parameters: level: MessageHandler.Level value.

This function sets the $IECORE_LOG_LEVEL environment variable, so child processes will inherit the log level. If the current message handler is also a LevelFilteredMessageHandler, this function pushes it from the stack and register the new one.

References IECore.debug(), and IECore.msg().

Referenced by IECore.setLogLevelByName().

def IECore.setLogLevelByName (   levelName)

Set the environment variable and the current LevelFilteredMessageHandler.

Parameters: level: a string with the name of the log level as defined in MessageHandler.Level.

This function sets the $IECORE_LOG_LEVEL environment variable, so child processes will inherit the log level. If the current message handler is also a LevelFilteredMessageHandler, this function pushes it from the stack and register the new one.

References IECore.setLogLevel().

def IECore.showCallStack ( )

Help function to track dificult errors.

It prints the callstack giving the module name and the line number.

def IECore.valueTypeFromSequenceType (   sequenceType)

Returns the type (class) used on each indexed value on the given sequence type.

For example: it returns 'int' for the IntVectorData class.