diff rhodecode/lib/utils.py @ 1401:b7563ad4e7ee beta

Unicode fixes, added safe_str method for global str() operations +better test sandboxing
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 30 Jun 2011 01:25:37 +0200
parents dc960653f8d2
children a773087f5e42
line wrap: on
line diff
--- a/rhodecode/lib/utils.py	Wed Jun 29 01:49:53 2011 +0200
+++ b/rhodecode/lib/utils.py	Thu Jun 30 01:25:37 2011 +0200
@@ -458,18 +458,22 @@
 #==============================================================================
 # TEST FUNCTIONS AND CREATORS
 #==============================================================================
-def create_test_index(repo_location, full_index):
-    """Makes default test index
-    :param repo_location:
+def create_test_index(repo_location, config, full_index):
+    """
+    Makes default test index
+    
+    :param config: test config
     :param full_index:
     """
+
     from rhodecode.lib.indexers.daemon import WhooshIndexingDaemon
     from rhodecode.lib.pidlock import DaemonLock, LockHeld
-    import shutil
+
+    repo_location = repo_location
 
-    index_location = os.path.join(repo_location, 'index')
-    if os.path.exists(index_location):
-        shutil.rmtree(index_location)
+    index_location = os.path.join(config['app_conf']['index_dir'], 'index')
+    if not os.path.exists(index_location):
+        os.makedirs(index_location)
 
     try:
         l = DaemonLock(file=jn(dn(index_location), 'make_index.lock'))