Exemplo n.º 1
0
 def filter_function(function):
     def function_filter(request, *args):
         do_hook = truthdict.get(request.line.uri, default)
         if do_hook:
             return function(*args)
     algorithm._transfer_func_name(function_filter, function)
     return function_filter
Exemplo n.º 2
0
 def filter_function(function):
     def function_filter(request, *args):
         for regex, disposition in regex_res:
             if regex.matches(request.line.uri):
                 if disposition:
                     return function(*args)
         if default:
             return function(*args)
     algorithm._transfer_func_name(function_filter, function)
     return function_filter
Exemplo n.º 3
0
 def wrap(function):
     def wrapped_function_by_lambda(*args,**kwargs):
         if filter_lambda():
             return function(*args,**kwargs)
     algorithm._transfer_func_name(wrapped_function_by_lambda, function)
     return wrapped_function_by_lambda