c.b.p.i.Substitution(object) : class documentation

Part of canonical.buildd.pottery.intltool View In Hierarchy

Find and replace substitutions.

Variable texts may contain other variables which should be substituted for their value. These are either marked by surrounding @ signs (autoconf style) or preceded by a $ sign with optional () (make style).

This class identifies a single such substitution in a variable text and extract the name of the variable who's value is to be inserted. It also facilitates the actual replacement so that caller does not have to worry about the substitution style that is being used.

Static Method get Factory method.
Method __init__ Extract substitution name from variable text.
Method replace Return a copy of the variable text with the substitution resolved.
Method _searchForPatterns Search for all the available patterns in variable text.
@staticmethod
def get(variabletext):
Factory method.

Creates a Substitution instance and checks if it found a substitution.

ParametersvariabletextA variable value with possible substitution.
ReturnsA Substitution object or None if no substitution was found.
def _searchForPatterns(self):
Search for all the available patterns in variable text.
def __init__(self, variabletext):
Extract substitution name from variable text.
def replace(self, value):
Return a copy of the variable text with the substitution resolved.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.