Next / Previous / Contents / Shipman's homepage

17.3. SpeciesSearcher.run(): Execute a search

There are three principal cases. If self.target contains four letters, we search for a 4-letter code. If it contains six letters, we search for a 6-letter code. Otherwise we treat it as a regular expression and search English names. See Section 17.4, “SpeciesSearcher.run4(): Four-letter code search”, Section 17.5, “SpeciesSearcher.run6(), and Section 17.6, “SpeciesSearcher.runEng().

baseclasses.py
# - - -   S p e c i e s S e a r c h e r . r u n   - - -

    def run(self):
        '''Execute a search.
        '''
        m = self.FOUR_LETTER_PAT.match(self.target)
        if  m:
            self.run4()
        else:
            m = self.SIX_LETTER_PAT.match(self.target)
            if  m:
                self.run6()
            else:
                self.runEng()