diff rhodecode/lib/indexers/__init__.py @ 1231:9f6560667743

fixes for stable
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 09 Apr 2011 17:13:15 +0200
parents 277427ac29a9
children bf263968da47
line wrap: on
line diff
--- a/rhodecode/lib/indexers/__init__.py	Sat Apr 09 11:22:32 2011 +0200
+++ b/rhodecode/lib/indexers/__init__.py	Sat Apr 09 17:13:15 2011 +0200
@@ -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 <marcin@python-works.com>
+    :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 <http://www.gnu.org/licenses/>.
 import os
 import sys
 import traceback
@@ -6,6 +30,8 @@
 #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 @@
         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))