mailr5693 - /1.3/generic_fns/selection.py


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

Header


Content

Posted by edward on April 14, 2008 - 16:50:
Author: bugman
Date: Mon Apr 14 16:50:04 2008
New Revision: 5693

URL: http://svn.gna.org/viewcvs/relax?rev=5693&view=rev
Log:
Renamed 'string' to 'id' in the Selection.wildcard_match() method.


Modified:
    1.3/generic_fns/selection.py

Modified: 1.3/generic_fns/selection.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/selection.py?rev=5693&r1=5692&r2=5693&view=diff
==============================================================================
--- 1.3/generic_fns/selection.py (original)
+++ 1.3/generic_fns/selection.py Mon Apr 14 16:50:04 2008
@@ -171,8 +171,8 @@
         self._union = (select_obj0, select_obj1)
 
 
-    def wildcard_match(self, string, patterns):
-        """Determine if the string is in the list of patterns, allowing for 
regular expressions.
+    def wildcard_match(self, id, patterns):
+        """Determine if the id is in the list of patterns, allowing for 
regular expressions.
 
         This method converts from relax's RE syntax to that of the re python 
module.
 
@@ -180,21 +180,23 @@
 
             1.  All '*' to '.*'.
 
-        @param string:      The molecule/res/spin name or number.
-        @type string:       None, str, or number
-        @param patterns:    A list of patterns to match.  This should be the 
output of
-                            parse_token().
+
+        @param id:          The identification object.
+        @type id:           None, str, or number
+        @param patterns:    A list of patterns to match.  The elements will 
be converted to strings,
+                            so the list can consist of anything.
+        @type patterns:     list
         @return:            True if there is a match, False otherwise.
         @rtype:             bool
         """
 
         # Catch None.
-        if string == None:
+        if id == None:
             return False
 
         # If a number, convert to a string.
-        if type(string) == int or type(string) == float:
-            string = str(string)
+        if type(id) == int or type(id) == float:
+            id = str(id)
 
         # Loop over the patterns.
         for pattern in patterns:
@@ -205,7 +207,7 @@
             pattern = replace(pattern, '*', '.*')
 
             # String matches.
-            if search(pattern, string):
+            if search(pattern, id):
                 return True
 
         # No matches.




Related Messages


Powered by MHonArc, Updated Mon Apr 14 17:00:26 2008