diff rhodecode/websetup.py @ 555:03676d39dd0a

added fault tolerant case when celeryconfig is not present in the directory. small form fixes, and websetup default app title and admin name
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 06 Oct 2010 18:26:59 +0200
parents 2642f128ad46
children 7ae66bddf48d
line wrap: on
line diff
--- a/rhodecode/websetup.py	Wed Oct 06 18:04:27 2010 +0200
+++ b/rhodecode/websetup.py	Wed Oct 06 18:26:59 2010 +0200
@@ -1,18 +1,13 @@
 """Setup the rhodecode application"""
-from os.path import dirname as dn, join as jn
 from rhodecode.config.environment import load_environment
 from rhodecode.lib.db_manage import DbManage
 import logging
 import os
-import shutil
 
 log = logging.getLogger(__name__)
-ROOT = dn(os.path.realpath(__file__))
 
 def setup_app(command, conf, vars):
     """Place any commands to setup rhodecode here"""
-    print dn(os.path.realpath(__file__))
-    print(ROOT)
     dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1] 
     dbmanage = DbManage(log_sql=True, dbname=dbname, root=conf['here'],
                          tests=False)
@@ -22,21 +17,8 @@
     dbmanage.admin_prompt()
     dbmanage.create_permissions()
     dbmanage.populate_default_permissions()
-    
-    celeryconfig_file = 'celeryconfig.py'
-    
-    celeryconfig_path = jn(ROOT, celeryconfig_file)
-    
-        
-    if not os.path.isfile(jn(conf['here'], celeryconfig_file)):
-        try:
-            shutil.copy(celeryconfig_path, conf['here'])
-        except IOError:
-            log.error('failed to copy celeryconfig.py from source %s ' 
-                      ' to this directory please copy it manually ',
-                      celeryconfig_path)
-        else:       
-            load_environment(conf.global_conf, conf.local_conf, initial=True)
+           
+    load_environment(conf.global_conf, conf.local_conf, initial=True)