SimObject.py (10001:61763318c788) | SimObject.py (10002:11a8fc907e5d) |
---|---|
1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 710 unchanged lines hidden (view full) --- 719 # If the attribute exists on the C++ object, transparently 720 # forward the reference there. This is typically used for 721 # SWIG-wrapped methods such as init(), regStats(), 722 # resetStats(), startup(), drain(), and 723 # resume(). 724 if self._ccObject and hasattr(self._ccObject, attr): 725 return getattr(self._ccObject, attr) 726 | 1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 710 unchanged lines hidden (view full) --- 719 # If the attribute exists on the C++ object, transparently 720 # forward the reference there. This is typically used for 721 # SWIG-wrapped methods such as init(), regStats(), 722 # resetStats(), startup(), drain(), and 723 # resume(). 724 if self._ccObject and hasattr(self._ccObject, attr): 725 return getattr(self._ccObject, attr) 726 |
727 raise AttributeError, "object '%s' has no attribute '%s'" \ | 727 err_string = "object '%s' has no attribute '%s'" \ |
728 % (self.__class__.__name__, attr) 729 | 728 % (self.__class__.__name__, attr) 729 |
730 if not self._ccObject: 731 err_string += "\n (C++ object is not yet constructed," \ 732 " so wrapped C++ methods are unavailable.)" 733 734 raise AttributeError, err_string 735 |
|
730 # Set attribute (called on foo.attr = value when foo is an 731 # instance of class cls). 732 def __setattr__(self, attr, value): 733 # normal processing for private attributes 734 if attr.startswith('_'): 735 object.__setattr__(self, attr, value) 736 return 737 --- 395 unchanged lines hidden --- | 736 # Set attribute (called on foo.attr = value when foo is an 737 # instance of class cls). 738 def __setattr__(self, attr, value): 739 # normal processing for private attributes 740 if attr.startswith('_'): 741 object.__setattr__(self, attr, value) 742 return 743 --- 395 unchanged lines hidden --- |