changeset 947:99850ac883d1 beta

Fixed whoosh daemon, for depracated walk method
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 21 Jan 2011 00:00:20 +0100
parents f12cd4707301
children 85ee0ea183e7
files rhodecode/lib/helpers.py rhodecode/lib/indexers/daemon.py
diffstat 2 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Sun Jan 16 16:51:32 2011 +0100
+++ b/rhodecode/lib/helpers.py	Fri Jan 21 00:00:20 2011 +0100
@@ -241,15 +241,16 @@
     """
 
     color_dict = {}
-    def gen_color():
-        """generator for getting 10k of evenly distibuted colors using hsv color
-        and golden ratio.
+    def gen_color(n=10000):
+        """generator for getting n of evenly distributed colors using 
+        hsv color and golden ratio. It always return same order of colors
+        
+        :returns: RGB tuple
         """
         import colorsys
-        n = 10000
         golden_ratio = 0.618033988749895
         h = 0.22717784590367374
-        #generate 10k nice web friendly colors in the same order
+
         for c in xrange(n):
             h += golden_ratio
             h %= 1
--- a/rhodecode/lib/indexers/daemon.py	Sun Jan 16 16:51:32 2011 +0100
+++ b/rhodecode/lib/indexers/daemon.py	Fri Jan 21 00:00:20 2011 +0100
@@ -4,22 +4,22 @@
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     A deamon will read from task table and run tasks
-    
+
     :created_on: Jan 26, 2010
     :author: marcink
-    :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>    
+    :copyright: (C) 2009-2011 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; version 2
 # of the License or (at your opinion) any later version of the license.
-# 
+#
 # 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, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
@@ -105,7 +105,8 @@
         """
         index_paths_ = set()
         try:
-            for topnode, dirs, files in repo.walk('/', 'tip'):
+            tip = repo.get_changeset('tip')
+            for topnode, dirs, files in tip.walk('/'):
                 for f in files:
                     index_paths_.add(jn(repo.path, f.path))
                 for dir in dirs: