Mercurial > hg > pyloader
comparison tests/objects.py @ 75:20bdb8125817
inline wrapper arguments now seem to work....thats....uncanny
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 09 Jun 2011 18:31:13 -0700 |
parents | cc361ad8a692 |
children | 2449fb4a89c1 |
comparison
equal
deleted
inserted
replaced
74:1f76705df520 | 75:20bdb8125817 |
---|---|
22 return number * self.factor | 22 return number * self.factor |
23 | 23 |
24 class Wrapper(object): | 24 class Wrapper(object): |
25 def __init__(self, app, **values): | 25 def __init__(self, app, **values): |
26 self.app = app | 26 self.app = app |
27 self.values = dict([(int(j), i) for i, j in values]) # TODO: should be automagically converted ideally via pyloader | 27 self.values = dict([(int(j), i) for i, j in values.items()]) # TODO: should be automagically converted ideally via pyloader |
28 def __call__(self, *args, **kwargs): | 28 def __call__(self, *args, **kwargs): |
29 retval = self.app(*args, **kwargs) | 29 retval = self.app(*args, **kwargs) |
30 values = {1: 'one', | 30 values = {1: 'one', |
31 2: 'two', | 31 2: 'two', |
32 3: 'three'} # etc | 32 3: 'three'} # etc |