diff --git a/rhodecode/lib/indexers/__init__.py b/rhodecode/lib/indexers/__init__.py --- a/rhodecode/lib/indexers/__init__.py +++ b/rhodecode/lib/indexers/__init__.py @@ -1,3 +1,27 @@ +# -*- coding: utf-8 -*- +""" + rhodecode.lib.indexers.__init__ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Whoosh indexing module for RhodeCode + + :created_on: Aug 17, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import sys import traceback @@ -6,6 +30,8 @@ from os.path import dirname as dn, join #to get the rhodecode import sys.path.append(dn(dn(dn(os.path.realpath(__file__))))) +from string import strip + from rhodecode.model import init_model from rhodecode.model.scm import ScmModel from rhodecode.config.environment import load_environment @@ -135,10 +161,12 @@ class ResultWrapper(object): for docid in self.doc_ids: yield self.get_full_content(docid) - def __getslice__(self, i, j): + def __getitem__(self, key): """ Slicing of resultWrapper """ + i, j = key.start, key.stop + slice = [] for docid in self.doc_ids[i:j]: slice.append(self.get_full_content(docid))