Commits

Jason R. Coombs committed 64c0955

Extract method for generating the search results.

  • Participants
  • Parent commits f259270

Comments (0)

Files changed (1)

pmxbot/logging.py

 		patterns = [re.compile('.*' + term + '.*') for term in terms]
 		query = dict(message = {'$all': patterns})
 
+		return self._generate_search_results(self.db.find(query))
+
+	def _generate_search_results(self, matched_entries):
 		matches = []
 		alllines = []
-		for match in self.db.find(query):
+		for match in matched_entries:
 			channel = match['channel']
 			row_date = lambda row: row['_id'].generation_time.date()
 			to_line = lambda row: (row['_id'].generation_time.time(),