Code

fix hackish message escaping (sf bug 757128)
[roundup.git] / roundup / cgi / PageTemplates / ComputedAttribute.py
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)