- Timestamp:
- 10/03/08 13:34:34 (7 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/blitz/resources/templates/combined.vm
r2865 r2866 1525 1525 [$pyc] def __getattr__(self, name): 1526 1526 [$pyc] """ 1527 [$pyc] Reroutes all access to object.field through object.getField() 1527 [$pyc] Reroutes all access to object.field through object.getField() or object.isField() 1528 1528 [$pyc] """ 1529 1529 [$pyc] field = "_" + name 1530 [$pyc] getter = "get" + name[0].capitalize() + name[1:] 1531 [$pyc] if hasattr(self, field) and hasattr(self, getter): 1532 [$pyc] method = getattr(self, getter) 1533 [$pyc] return method() 1530 [$pyc] capitalized = name[0].capitalize() + name[1:] 1531 [$pyc] getter = "get" + capitalized 1532 [$pyc] questn = "is" + capitalized 1533 [$pyc] if hasattr(self, field): 1534 [$pyc] if hasattr(self, getter): 1535 [$pyc] method = getattr(self, getter) 1536 [$pyc] return method() 1537 [$pyc] elif hasattr(self, questn): 1538 [$pyc] method = getattr(self, questn) 1539 [$pyc] return method() 1534 1540 [$pyc] else: 1535 [$pyc] raise AttributeError("'%s' object has no attribute '%s' " % (self.__class__.__name__, getter))1541 [$pyc] raise AttributeError("'%s' object has no attribute '%s' or '%s'" % (self.__class__.__name__, getter, questn)) 1536 1542 [$pyc] 1537 1543 [$pyc] def __setattr__(self, name, value):
