Logo Search packages:      
Sourcecode: rapid-spring version File versions  Download package

def rapid::main::TextUserInteraction::select (   self,
  noun,
  needle,
  haystack 
)
Select items from a list based on needle, and take appropriate
action based on the number of results this returns.

Definition at line 55 of file main.py.

                                              :
            """ Select items from a list based on needle, and take appropriate
            action based on the number of results this returns."""
            selected = self._select_core(needle, haystack)

            if len(selected) == 0:
                  print 'No %ss matching "%s" found.' % (noun, needle)
                  return selected

            if len(selected) >= 100:
                  print '100 or more %ss matching "%s" found, please narrow your search.' % (noun, needle)
                  return []

            if len(selected) > 1:
                  return self.choose_many('Multiple %ss matching "%s" found:' % (noun, needle), selected, 'Which %s do you mean?' % noun)

            return selected


Generated by  Doxygen 1.6.0   Back to index