diff -r 13975aa16b4c -r 8157c41b3236 log_search.py --- a/log_search.py Mon Feb 09 12:11:34 2009 +0200 +++ b/log_search.py Mon Feb 09 12:59:03 2009 +0200 @@ -53,11 +53,13 @@ def insert (self, channel, lines) : """ - Adds a sequence of LogLines from the given LogChannel to the index + Adds a sequence of LogLines from the given LogChannel to the index, and return the number of added items """ # validate the LogChannel assert channel.name + + count = 0 # iterate for line in lines : @@ -100,7 +102,13 @@ # XXX: what does this flag mean? if not self.db.put_doc(doc, hype.Database.PDCLEAN) : raise Exeception("Index put_doc failed") - + + # count + count += 1 + + # return + return count + def search_cond (self, cond) : """ Search using a raw hype.Condition