Author: bugman Date: Sun Jun 22 15:23:21 2008 New Revision: 6393 URL: http://svn.gna.org/viewcvs/relax?rev=6393&view=rev Log: Converted the mod_attr object into a class variable. Modified: 1.3/data/diff_tensor.py Modified: 1.3/data/diff_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/diff_tensor.py?rev=6393&r1=6392&r2=6393&view=diff ============================================================================== --- 1.3/data/diff_tensor.py (original) +++ 1.3/data/diff_tensor.py Sun Jun 22 15:23:21 2008 @@ -556,6 +556,19 @@ # Set the initial diffusion type to None. type = None + # List of modifiable attributes. + __mod_attr__ = ['type', + 'fixed', + 'spheroid_type', + 'tm', + 'Da', + 'Dr', + 'theta', + 'phi', + 'alpha', + 'beta', + 'gamma'] + def __setattr__(self, name, value): """Function for calculating the parameters, unit vectors, and tensors on the fly. @@ -576,21 +589,8 @@ category = 'val' param_name = name - # List of modifiable attributes. - mod_attr = ['type', - 'fixed', - 'spheroid_type', - 'tm', - 'Da', - 'Dr', - 'theta', - 'phi', - 'alpha', - 'beta', - 'gamma'] - # Test if the attribute that is trying to be set is modifiable. - if not param_name in mod_attr: + if not param_name in self.__mod_attr__: raise RelaxError, "The object " + `name` + " is not modifiable." # Set the attribute normally.