mailr16500 - /branches/uf_redesign/specific_fns/api_objects.py


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

Header


Content

Posted by edward on May 29, 2012 - 11:02:
Author: bugman
Date: Tue May 29 11:02:55 2012
New Revision: 16500

URL: http://svn.gna.org/viewcvs/relax?rev=16500&view=rev
Log:
Added the 'scope' arg to the specific API param list add() method.

This will be used to merge the GLOBAL_PARAMS and SPIN_PARAMS lists into one.


Modified:
    branches/uf_redesign/specific_fns/api_objects.py

Modified: branches/uf_redesign/specific_fns/api_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/api_objects.py?rev=16500&r1=16499&r2=16500&view=diff
==============================================================================
--- branches/uf_redesign/specific_fns/api_objects.py (original)
+++ branches/uf_redesign/specific_fns/api_objects.py Tue May 29 11:02:55 2012
@@ -45,6 +45,7 @@
 
         # Initialise the lists and dictionaries for the parameter info.
         self._names = []
+        self._scope = {}
         self._string = {}
         self._defaults = {}
         self._units = {}
@@ -57,11 +58,13 @@
         self._sim = {}
 
 
-    def add(self, name, string=None, default=None, units=None, desc=None, 
py_type=None, param_set='generic', conv_factor=None, grace_string=None, 
err=False, sim=False):
+    def add(self, name, scope=None, string=None, default=None, units=None, 
desc=None, py_type=None, param_set='generic', conv_factor=None, 
grace_string=None, err=False, sim=False):
         """Add a parameter to the list.
 
         @param name:            The name of the parameter.  This will be 
used as the variable name.
         @type name:             str
+        @keyword scope:         The parameter scope.  This can be set to 
'global' for parameters located within the global scope of the current data 
pipe.  Or set to 'spin' for spin specific parameters.
+        @type scope:            str
         @keyword string:        The string representation of the parameter.
         @type string:           None or str
         @keyword default:       The default value of the parameter.
@@ -84,8 +87,13 @@
         @type sim:              bool
         """
 
+        # Check.
+        if scope == None:
+            raise RelaxError("The parameter scope must be set.")
+
         # Add the values.
         self._names.append(name)
+        self._scope[name] = scope
         self._defaults[name] = default
         self._units[name] = units
         self._desc[name] = desc




Related Messages


Powered by MHonArc, Updated Tue May 29 11:20:02 2012