Exemple #1
0
def trying(params):
    """Try to walk and handle exceptions."""
    # If a variable is provided.
    if 'var' in params['var']:
        setvariable(
            params['var']['var'],
            params['var']['delimiter'],
            '',
            params['var']['owner']
        )
    # Try to walk through this node.
    try:
        params['string'] = suit.walk(
            params['rules'],
            params['tree'],
            params['config']
        )
    # Catch all exceptions.
    except Exception, e:
        # If a variable is provided.
        if 'var' in params['var']:
            setvariable(
                params['var']['var'],
                params['var']['delimiter'],
                e,
                params['var']['owner']
            )
        # Collapse the node.
        params['string'] = ''
Exemple #2
0
def walk(params):
    """Walk through this node."""
    params['string'] = suit.walk(
        params['rules'],
        params['tree'],
        params['config']
    )
    return params
Exemple #3
0
def trying(params):
    """Try to walk and handle exceptions."""
    if 'var' in params['var'] and params['var']['var']:
        setattr(suit, params['var']['var'], '')
    # Try to walk through this node.
    try:
        params['string'] = suit.walk(params['rules'], params['tree'],
                                     params['config'])
    # Catch all exceptions.
    except Exception, inst:
        # If a variable is provided.
        if 'var' in params['var']:
            setvariable(params['var']['var'], params['var']['delimiter'], inst,
                        params['var']['owner'])
        # Collapse the node.
        params['string'] = ''
Exemple #4
0
def walk(params):
    """Walk through this node."""
    params['string'] = suit.walk(params['rules'], params['tree'],
                                 params['config'])
    return params