Exemplo n.º 1
0
 def make_searcher(self, text1=None, text2=None):
     """Make a _StackedRulesSearcher with 0, 1 or 2 items"""
     searchers = []
     if text1 is not None:
         searchers.append(rules._IniBasedRulesSearcher(text1.splitlines()))
     if text2 is not None:
         searchers.append(rules._IniBasedRulesSearcher(text2.splitlines()))
     return rules._StackedRulesSearcher(searchers)
Exemplo n.º 2
0
 def make_searcher(self, text):
     """Make a _RulesSearcher from a string"""
     if text is None:
         lines = None
     else:
         lines = text.splitlines()
     return rules._IniBasedRulesSearcher(lines)
Exemplo n.º 3
0
 def make_per_user_searcher(self, text):
     """Make a _RulesSearcher from a string"""
     return rules._IniBasedRulesSearcher(text.splitlines(True))