Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit 33df9f0ac5512107efb6e3c8aa1e9e6864bac400

Fix search in txt files - part of SL #3924

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
  
1717# remove hard line breaks, apply a simple logic to try identify
1818# the unneeded
1919def _clean_text(line):
20 if line != '\r\n':
20 if line != '\r\n' and len(line) > 2:
2121 if line[-3] not in ('.', ',', '-', ';') and len(line) > 60:
2222 line = line[:-2]
2323 return line
606606 def find_next(self):
607607 self._current_found_item = self._current_found_item + 1
608608 if self._current_found_item >= len(self._found_records):
609 self._current_found_item = len(self._found_records) - 1
609 self._current_found_item = 0
610610 self.current_found_tuple = \
611611 self._found_records[self._current_found_item]
612612 self._page = self.current_found_tuple[0]
615615 def find_previous(self):
616616 self._current_found_item = self._current_found_item - 1
617617 if self._current_found_item <= 0:
618 self._current_found_item = 0
618 self._current_found_item = len(self._found_records) - 1
619619 self.current_found_tuple = \
620620 self._found_records[self._current_found_item]
621621 self._page = self.current_found_tuple[0]