# HG changeset patch # User Marcin Kuzminski # Date 1286382419 -7200 # Node ID 03676d39dd0a1a7b14625771d92a57020641f540 # Parent 100b0aea57c2ae55bb8883d8fd69e2ba3d38a7f3 added fault tolerant case when celeryconfig is not present in the directory. small form fixes, and websetup default app title and admin name diff -r 100b0aea57c2 -r 03676d39dd0a rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py Wed Oct 06 18:04:27 2010 +0200 +++ b/rhodecode/lib/celerylib/tasks.py Wed Oct 06 18:26:59 2010 +0200 @@ -1,6 +1,5 @@ from celery.decorators import task -from celery.task.sets import subtask -from celeryconfig import PYLONS_CONFIG as config + from operator import itemgetter from pylons.i18n.translation import _ from rhodecode.lib.celerylib import run_task, locked_task @@ -12,6 +11,14 @@ import json import traceback +try: + from celeryconfig import PYLONS_CONFIG as config +except ImportError: + #if celeryconfig is not present let's just load our pylons + #config instead + from pylons import config + + __all__ = ['whoosh_index', 'get_commits_stats', 'reset_user_password', 'send_email'] diff -r 100b0aea57c2 -r 03676d39dd0a rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py Wed Oct 06 18:04:27 2010 +0200 +++ b/rhodecode/lib/db_manage.py Wed Oct 06 18:26:59 2010 +0200 @@ -150,11 +150,11 @@ hgsettings1 = RhodeCodeSettings() hgsettings1.app_settings_name = 'realm' - hgsettings1.app_settings_value = 'rhodecode authentication' + hgsettings1.app_settings_value = 'RhodeCode authentication' hgsettings2 = RhodeCodeSettings() hgsettings2.app_settings_name = 'title' - hgsettings2.app_settings_value = 'rhodecode' + hgsettings2.app_settings_value = 'RhodeCode' try: self.sa.add(hooks1) @@ -177,7 +177,7 @@ new_user = User() new_user.username = username new_user.password = get_crypt_password(password) - new_user.name = 'Hg' + new_user.name = 'RhodeCode' new_user.lastname = 'Admin' new_user.email = email new_user.admin = admin diff -r 100b0aea57c2 -r 03676d39dd0a rhodecode/model/forms.py --- a/rhodecode/model/forms.py Wed Oct 06 18:04:27 2010 +0200 +++ b/rhodecode/model/forms.py Wed Oct 06 18:26:59 2010 +0200 @@ -260,7 +260,7 @@ not_empty=True, messages={ 'empty':_('Please enter a password'), - 'tooShort':_('Enter a value %(min)i characters long or more')} + 'tooShort':_('Enter %(min)i characters or more')} ) diff -r 100b0aea57c2 -r 03676d39dd0a rhodecode/websetup.py --- 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)