Changeset 2650

Show
Ignore:
Timestamp:
02/08/06 13:21:50 (18 years ago)
Author:
jerome
Message:

A string matches if there's no pattern now.
Now uses the True and False constants instead of 0 and 1.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r2643 r2650  
    206206         
    207207    def matchString(self, s, patterns) : 
    208         """Returns 1 if the string s matches one of the patterns, else 0.""" 
    209         for pattern in patterns : 
    210             if fnmatch.fnmatchcase(s, pattern) : 
    211                 return 1 
    212         return 0 
     208        """Returns True if the string s matches one of the patterns, else False.""" 
     209        if not patterns : 
     210            return True # No pattern, always matches. 
     211        else :     
     212            for pattern in patterns : 
     213                if fnmatch.fnmatchcase(s, pattern) : 
     214                    return True 
     215            return False 
    213216         
    214217    def display_version_and_quit(self) :