# HG changeset patch # User Jeff Hammel # Date 1307499087 25200 # Node ID 362912842985faffff7a272a5ed9f6ae1c3883e6 # Parent 850d31be0fb87b38f42beca37061760f6ba08084 start stubbing out wrappers....i am somewhat perplexed diff -r 850d31be0fb8 -r 362912842985 tests/objects.py --- a/tests/objects.py Tue Jun 07 18:58:38 2011 -0700 +++ b/tests/objects.py Tue Jun 07 19:11:27 2011 -0700 @@ -20,3 +20,22 @@ self.factor = a*100 + b def __call__(self, number): return number * self.factor + +class Wrapper(object): + def __init__(self, app): + self.app = app + def __call__(self, *args, **kwargs): + retval = self.app(*args, **kwargs) + values = {1: 'one', + 2: 'two', + 3: 'three'} # etc + if retval in values: + return values[retval] + return retval + +def wrap(app): + return Wrapper(app) + +def fib(n): + """return the nth fibonacci term""" + diff -r 850d31be0fb8 -r 362912842985 tests/test.ini --- a/tests/test.ini Tue Jun 07 18:58:38 2011 -0700 +++ b/tests/test.ini Tue Jun 07 19:11:27 2011 -0700 @@ -3,4 +3,7 @@ delimeter = !!! callback = %(callback)s -[callback:%(here)s/objects.py:stringsort] \ No newline at end of file +[callback:%(here)s/objects.py:stringsort] + +[@:%(here)s/objects.py:wrap] +app = %(object)s