mailr15175 - /branches/spec_api/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 January 18, 2012 - 16:44:
Author: bugman
Date: Wed Jan 18 16:44:42 2012
New Revision: 15175

URL: http://svn.gna.org/viewcvs/relax?rev=15175&view=rev
Log:
The internal objects of the Param_list object are now private.


Modified:
    branches/spec_api/specific_fns/api_objects.py

Modified: branches/spec_api/specific_fns/api_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/api_objects.py?rev=15175&r1=15174&r2=15175&view=diff
==============================================================================
--- branches/spec_api/specific_fns/api_objects.py (original)
+++ branches/spec_api/specific_fns/api_objects.py Wed Jan 18 16:44:42 2012
@@ -34,11 +34,11 @@
         """Set up the class."""
 
         # Initialise the lists and dictionaries for the parameter info.
-        self.names = []
-        self.string = {}
-        self.defaults = {}
-        self.units = {}
-        self.grace_string = {}
+        self._names = []
+        self._string = {}
+        self._defaults = {}
+        self._units = {}
+        self._grace_string = {}
 
 
     def add(self, name, string=None, default=None, units=None, 
grace_string=None):
@@ -57,21 +57,21 @@
         """
 
         # Append the values.
-        self.names.append(name)
-        self.defaults[name] = default
-        self.units[name] = units
+        self._names.append(name)
+        self._defaults[name] = default
+        self._units[name] = units
 
         # The parameter string.
         if string:
-            self.string[name] = string
+            self._string[name] = string
         else:
-            self.string[name] = name
+            self._string[name] = name
 
         # The Grace string.
         if grace_string:
-            self.grace_string[name] = grace_string
+            self._grace_string[name] = grace_string
         else:
-            self.grace_string[name] = name
+            self._grace_string[name] = name
 
 
     def contains(self, name):
@@ -84,7 +84,7 @@
         """
 
         # Check.
-        if name in self.names:
+        if name in self._names:
             return True
 
         # No match.
@@ -101,11 +101,11 @@
         """
 
         # Check.
-        if name not in self.names:
+        if name not in self._names:
             raise RelaxError("The parameter '%s' does not exist." % name)
 
         # Return the value.
-        return self.grace_string[name]
+        return self._grace_string[name]
 
 
     def get_units(self, name):
@@ -118,8 +118,8 @@
         """
 
         # Check.
-        if name not in self.names:
+        if name not in self._names:
             raise RelaxError("The parameter '%s' does not exist." % name)
 
         # Return the value.
-        return self.units[name]
+        return self._units[name]




Related Messages


Powered by MHonArc, Updated Wed Jan 18 17:00:01 2012