Mercurial > p > roundup > code
comparison roundup/cgi/ComputedAttribute.py @ 985:55ab0c5b49f9
New CGI interface support
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 30 Aug 2002 08:28:44 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 984:a3a8ac7b8c40 | 985:55ab0c5b49f9 |
|---|---|
| 1 class ComputedAttribute: | |
| 2 def __init__(self, callable, level): | |
| 3 self.callable = callable | |
| 4 self.level = level | |
| 5 def __of__(self, *args): | |
| 6 if self.level > 0: | |
| 7 return self.callable | |
| 8 if isinstance(self.callable, type('')): | |
| 9 return getattr(args[0], self.callable) | |
| 10 return self.callable(*args) | |
| 11 |
