Module Expr Str Assign NameStore Str Assign NameStore Str Import alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad NameLoad NameLoad Return TupleLoad NameLoad Call AttributeLoad NameLoad attr decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str Str body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Str Assign NameStore ListLoad Assign NameStore Num While Num body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If CompareLt NameLoad Num body Break Assign NameStore SubscriptLoad NameLoad Index BinOpAdd NameLoad Num If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice NameLoad NameLoad Assign TupleStore NameStore NameStore TupleLoad BinOpAdd NameLoad Num Num While NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num orelse If CompareEq NameLoad Str body Assign NameStore BinOpSub NameLoad Num Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num BinOpSub NameLoad Num orelse If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad BinOpAdd NameLoad Num While CompareLt NameLoad Call NameLoad NameLoad body If BoolOpAnd CompareEq SubscriptLoad NameLoad Index NameLoad Str CompareLt BinOpAdd NameLoad Num Call NameLoad NameLoad CompareIn SubscriptLoad NameLoad Index BinOpAdd NameLoad Num NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad BinOpAdd NameLoad Num orelse If CompareIn SubscriptLoad NameLoad Index NameLoad Str body Assign TupleStore NameStore NameStore TupleLoad BinOpAdd NameLoad Num Num While NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad If CompareIn SubscriptLoad NameLoad Index Num Str body Assign NameStore BinOpAdd NameLoad Num orelse If CompareIn SubscriptLoad NameLoad Index Num Str body Assign NameStore BinOpSub NameLoad Num orelse Break Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num NameLoad orelse Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpAdd BinOpAdd NameLoad Num CompareEq NameLoad Str If CompareLt NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad Num SubscriptLoad NameLoad Slice NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore AttributeLoad NameLoad attr body If NameLoad body Expr Call NameLoad Call NameLoad Call NameLoad NameLoad NameLoad NameLoad orelse Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad TryExcept body Return Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num While CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Print Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Return Call NameLoad Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Print Call NameLoad NameLoad NameLoad NameLoad decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults AttributeLoad NameLoad attr body Expr Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Return BoolOpOr BoolOpAnd NameLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list
N/A N/A String interpolation for Python (by Ka-Ping Yee, 14 Feb 2000).

This module lets you quickly and conveniently interpolate values into
strings (in the flavour of Perl or Tcl, but with less extraneous
punctuation).  You get a bit more power than in the other languages,
because this module allows subscripting, slicing, function calls,
attribute lookup, or arbitrary expressions.  Variables and expressions
are evaluated in the namespace of the caller.

The itpl() function returns the result of interpolating a string, and
printpl() prints out an interpolated string.  Here are some examples:

    from Itpl import printpl
    printpl("Here is a $string.")
    printpl("Here is a $module.member.")
    printpl("Here is an $object.member.")
    printpl("Here is a $functioncall(with, arguments).")
    printpl("Here is an ${arbitrary + expression}.")
    printpl("Here is an $array[3] member.")
    printpl("Here is a $dictionary['member'].")

The filter() function filters a file object so that output through it
is interpolated.  This lets you produce the illusion that Python knows
how to do interpolation:

    import Itpl
    sys.stdout = Itpl.filter()
    f = "fancy"
    print "Is this not $f?"
    print "Standard output has been replaced with a $sys.stdout object."
    sys.stdout = Itpl.unfilter()
    print "Okay, back $to $normal."

Under the hood, the Itpl class represents a string that knows how to
interpolate values.  An instance of the class parses the string once
upon initialization; the evaluation and substitution can then be done
each time the instance is evaluated with str(instance).  For example:

    from Itpl import Itpl
    s = Itpl("Here is $foo.")
    foo = 5
    print str(s)
    foo = "bar"
    print str(s)
 N/A __author__ Ka-Ping Yee <ping@lfw.org> N/A __license__ MIT N/A sys tokenize tokenprog ItplError N/A ValueError N/A __init__ N/A N/A self text pos N/A N/A N/A N/A self text text N/A N/A self pos pos N/A __str__ N/A N/A self N/A N/A N/A N/A unfinished expression in %s at char %d N/A N/A repr N/A self text N/A self pos N/A N/A matchorfail N/A N/A text pos N/A N/A N/A match N/A N/A tokenprog match text pos N/A N/A match None N/A N/A N/A ItplError text pos N/A N/A match N/A N/A match end N/A Itpl N/A N/A N/A Class representing a string with interpolation abilities.
    
    Upon creation, an instance works out what parts of the format
    string are literal and what parts need to be evaluated.  The
    evaluation and substitution happens in the namespace of the
    caller when str(instance) is called. __init__ N/A N/A self format codec encoding_errors N/A utf_8 backslashreplace N/A N/A The single mandatory argument to this constructor is a format
        string.

        The format string is parsed according to the following rules:

        1.  A dollar sign and a name, possibly followed by any of: 
              - an open-paren, and anything up to the matching paren 
              - an open-bracket, and anything up to the matching bracket 
              - a period and a name 
            any number of times, is evaluated as a Python expression.

        2.  A dollar sign immediately followed by an open-brace, and
            anything up to the matching close-brace, is evaluated as
            a Python expression.

        3.  Outside of the expressions described in the above two rules,
            two dollar signs in a row give you one literal dollar sign.

        Optional arguments:

        - codec('utf_8'): a string containing the name of a valid Python
        codec.

        - encoding_errors('backslashreplace'): a string with a valid error handling
        policy.  See the codecs module documentation for details.

        These are used to encode the format string if a call to str() fails on
        the expanded result. N/A N/A N/A isinstance format str N/A N/A N/A TypeError needs string initializer N/A N/A self format format N/A N/A self codec codec N/A N/A self encoding_errors encoding_errors N/A namechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ N/A chunks N/A N/A pos 0 N/A 1 N/A N/A dollar N/A N/A format find $ pos N/A N/A dollar 0 N/A N/A N/A nextchar N/A format N/A N/A dollar 1 N/A N/A nextchar { N/A N/A N/A N/A chunks append N/A 0 N/A format N/A pos dollar N/A N/A pos level N/A N/A dollar 2 1 N/A level N/A N/A N/A match pos N/A matchorfail format pos N/A N/A tstart tend N/A N/A match regs N/A 3 N/A token N/A format N/A tstart tend N/A N/A token { N/A N/A level N/A level 1 N/A N/A N/A token } N/A N/A level N/A level 1 N/A N/A N/A chunks append N/A 1 N/A format N/A N/A dollar 2 N/A pos 1 N/A N/A N/A nextchar namechars N/A N/A N/A N/A chunks append N/A 0 N/A format N/A pos dollar N/A N/A match pos N/A matchorfail format N/A dollar 1 N/A N/A pos N/A len format N/A N/A N/A N/A N/A format N/A pos . N/A N/A pos 1 N/A len format N/A N/A format N/A N/A pos 1 namechars N/A N/A N/A match pos N/A matchorfail format N/A pos 1 N/A N/A N/A N/A format N/A pos ([ N/A N/A N/A pos level N/A N/A pos 1 1 N/A level N/A N/A N/A match pos N/A matchorfail format pos N/A N/A tstart tend N/A N/A match regs N/A 3 N/A token N/A format N/A tstart tend N/A N/A N/A token N/A 0 ([ N/A N/A level N/A level 1 N/A N/A N/A N/A token N/A 0 )] N/A N/A level N/A level 1 N/A N/A N/A N/A N/A chunks append N/A 1 N/A format N/A N/A dollar 1 pos N/A N/A N/A N/A chunks append N/A 0 N/A format N/A pos N/A dollar 1 N/A pos N/A N/A dollar 1 N/A nextchar $ N/A N/A pos N/A len format N/A N/A N/A N/A chunks append N/A 0 N/A format N/A pos N/A N/A self chunks chunks N/A __repr__ N/A N/A self N/A N/A N/A N/A <Itpl %s > N/A repr N/A self format N/A _str N/A N/A self glob loc N/A N/A N/A Evaluate to a string in the given globals/locals.

        The final output is built by calling str(), but if this fails, the
        result is encoded with the instance's codec and error handling policy,
        via a call to out.encode(self.codec,self.encoding_errors) N/A result N/A N/A app N/A result append N/A N/A live chunk N/A self chunks N/A N/A live N/A N/A N/A app N/A str N/A eval chunk glob loc N/A N/A N/A app chunk N/A out N/A N/A join result N/A N/A N/A N/A str out N/A N/A N/A UnicodeError N/A N/A N/A N/A out encode N/A self codec N/A self encoding_errors N/A __str__ N/A N/A self N/A N/A N/A Evaluate and substitute the appropriate parts of the string. N/A frame N/A N/A sys _getframe 1 N/A N/A N/A N/A frame f_globals N/A __name__ __name__ N/A N/A frame N/A frame f_back N/A N/A loc glob N/A N/A frame f_locals N/A frame f_globals N/A N/A N/A self _str glob loc N/A N/A ItplNS N/A Itpl N/A N/A Class representing a string with interpolation abilities.

    This inherits from Itpl, but at creation time a namespace is provided
    where the evaluation will occur.  The interpolation becomes a bit more
    efficient, as no traceback needs to be extracte.  It also allows the
    caller to supply a different namespace for the interpolation to occur than
    its own. __init__ N/A N/A self format globals locals codec encoding_errors N/A None utf_8 backslashreplace N/A N/A ItplNS(format,globals[,locals]) -> interpolating string instance.

        This constructor, besides a format string, takes a globals dictionary
        and optionally a locals (which defaults to globals if not provided).

        For further details, see the Itpl constructor. N/A N/A locals None N/A N/A locals globals N/A N/A self globals globals N/A N/A self locals locals N/A N/A N/A Itpl __init__ self format codec encoding_errors N/A __str__ N/A N/A self N/A N/A N/A Evaluate and substitute the appropriate parts of the string. N/A N/A N/A self _str N/A self globals N/A self locals N/A __repr__ N/A N/A self N/A N/A N/A N/A <ItplNS %s > N/A repr N/A self format N/A N/A itpl N/A N/A text N/A N/A N/A N/A str N/A Itpl text N/A printpl N/A N/A text N/A N/A N/A N/A itpl text N/A itplns N/A N/A text globals locals N/A None N/A N/A N/A str N/A ItplNS text globals locals N/A printplns N/A N/A text globals locals N/A None N/A N/A N/A itplns text globals locals N/A ItplFile N/A N/A N/A A file object that filters each write() through an interpolator. __init__ N/A N/A self file N/A N/A N/A N/A self file file N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A <interpolated  N/A repr N/A self file > N/A __getattr__ N/A N/A self attr N/A N/A N/A N/A getattr N/A self file attr N/A write N/A N/A self text N/A N/A N/A N/A N/A N/A self file write N/A str N/A Itpl text N/A N/A filter N/A N/A file N/A N/A sys stdout N/A N/A Return an ItplFile that filters writes to the given file object.
    
    'file = filter(file)' replaces 'file' with a filtered object that
    has a write() method.  When called with no argument, this creates
    a filter to sys.stdout. N/A N/A ItplFile file N/A unfilter N/A N/A ifile N/A None N/A N/A Return the original file that corresponds to the given ItplFile.
    
    'file = unfilter(file)' undoes the effect of 'file = filter(file)'.
    'sys.stdout = unfilter()' undoes the effect of 'sys.stdout = filter()'. N/A N/A N/A ifile N/A ifile file N/A N/A sys stdout file N/A