fdutils/decorators.py
def context_if(flag, context_func, *context_func_args, **context_func_kwargs):
    """ sets a context around a statement if the flag is true
        
        you would called it like:
        
            with context_if(flag, context):
                my_function()
    
    """

    if flag:
        with context_func(*context_func_args, **context_func_kwargs):
            yield
    else:
        yield
 sets a context around a statement if the flag is true
        
        you would called it like:
        
            with context_if(flag, context):
                my_function()
    
    
sets a context around a statement if the flag is true
you would called it like.


sets a context around a statement if the flag is true you would called it like .
def context_if(flag, context_func, *context_func_args, **context_func_kwargs):
    if flag:
        with context_func(*context_func_args, **context_func_kwargs):
            yield
    else:
        yield
def context_if ( flag , context_func , * context_func_args , ** context_func_kwargs ) : if flag : with context_func ( * context_func_args , ** context_func_kwargs ) : yield else : yield
sets a context around a statement if the flag is true
you would called it like:
sets a context around a statement if the flag is true you would called it like :
""" sets a context around a statement if the flag is true
        
        you would called it like:
        
            with context_if(flag, context):
                my_function()
    
    """
flag
context_func