mailr4385 - /1.3/specific_fns/base_class.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 06, 2008 - 01:05:
Author: bugman
Date: Sun Jan  6 01:05:05 2008
New Revision: 4385

URL: http://svn.gna.org/viewcvs/relax?rev=4385&view=rev
Log:
Bug fix for the base class value setting method set().

If no default value exists, this is now caught and a RelaxError is thrown.


Modified:
    1.3/specific_fns/base_class.py

Modified: 1.3/specific_fns/base_class.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/base_class.py?rev=4385&r1=4384&r2=4385&view=diff
==============================================================================
--- 1.3/specific_fns/base_class.py (original)
+++ 1.3/specific_fns/base_class.py Sun Jan  6 01:05:05 2008
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2004, 2006-2007 Edward d'Auvergne                            
 #
+# Copyright (C) 2004, 2006-2008 Edward d'Auvergne                            
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -25,7 +25,7 @@
 
 # relax module imports.
 from data import Data as relax_data_store
-from relax_errors import RelaxError
+from relax_errors import RelaxError, RelaxParamSetError
 
 
 # The relax data storage object.
@@ -218,6 +218,10 @@
             if value == None:
                 value = self.default_value(object_name)
 
+            # No default value, hence the parameter cannot be set.
+            if value == None:
+                raise RelaxParamSetError, param
+
             # Set the value.
             if value == None:
                 setattr(spin, object_name, None)




Related Messages


Powered by MHonArc, Updated Sun Jan 06 01:20:37 2008