view rhodecode/websetup.py @ 560:3072935bdeed

rewrote whoosh indexing to run internal repository.walk() instead of filesystem. Disabled default hg update hook (not needed since whoosh is not dependent on file system files to index)
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 09 Oct 2010 00:22:19 +0200
parents 03676d39dd0a
children 7ae66bddf48d
line wrap: on
line source

"""Setup the rhodecode application"""
from rhodecode.config.environment import load_environment
from rhodecode.lib.db_manage import DbManage
import logging
import os

log = logging.getLogger(__name__)

def setup_app(command, conf, vars):
    """Place any commands to setup rhodecode here"""
    dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1] 
    dbmanage = DbManage(log_sql=True, dbname=dbname, root=conf['here'],
                         tests=False)
    dbmanage.create_tables(override=True)
    dbmanage.config_prompt(None)
    dbmanage.create_default_user()
    dbmanage.admin_prompt()
    dbmanage.create_permissions()
    dbmanage.populate_default_permissions()
           
    load_environment(conf.global_conf, conf.local_conf, initial=True)