Changeset 566

Show
Ignore:
Timestamp:
07/12/08 01:55:02 (5 months ago)
Author:
athomas
Message:

Add delegate function to Context, for updating locals during XML evaluation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cly/trunk/cly/builder.py

    r565 r566  
    11081108            vars = context.vars 
    11091109        else: 
     1110            context = None 
    11101111            data = {} 
    11111112            vars = {} 
     
    11161117        locals['d'] = data 
    11171118        locals['c'] = context 
     1119        if context is not None: 
     1120            context.update_locals(locals) 
    11181121        try: 
    11191122            return eval(attr, locals) 
  • cly/trunk/cly/parser.py

    r564 r566  
    259259        """ 
    260260        return self._traversed.get(node.path(), 0) 
     261 
     262    def update_locals(self, locals): 
     263        """Update locals before XML evaluation.""" 
     264        return locals 
    261265 
    262266    def __repr__(self):