Files
@ b12ea84fb906
Branch filter:
Location: kallithea/pylons_app/websetup.py - annotation
b12ea84fb906
1.4 KiB
text/x-python
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph.
Some small fixes for tasks (sorting,limit)
Some small fixes for tasks (sorting,limit)
564e40829f80 0e87466a117e 6b934c9607e7 0e87466a117e 0e87466a117e 564e40829f80 0e87466a117e 0e87466a117e e94f4e54dc03 564e40829f80 564e40829f80 0e87466a117e 0e87466a117e 0e87466a117e 6b934c9607e7 564e40829f80 564e40829f80 7c978511c951 7c978511c951 6b934c9607e7 7c978511c951 7c978511c951 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 6b934c9607e7 7c978511c951 7c978511c951 0e87466a117e 7c978511c951 7c978511c951 0e87466a117e 0e87466a117e 3ed2d46a2ca7 ec7b76d4bda4 0e87466a117e | """Setup the pylons_app application"""
from os.path import dirname as dn
from pylons_app.config.environment import load_environment
from pylons_app.lib.db_manage import DbManage
import logging
import os
import sys
log = logging.getLogger(__name__)
ROOT = dn(dn(os.path.realpath(__file__)))
sys.path.append(ROOT)
def setup_app(command, conf, vars):
"""Place any commands to setup pylons_app here"""
log_sql = True
tests = False
REPO_TEST_PATH = None
dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1]
# filename = os.path.split(conf.filename)[-1]
# if filename == 'test.ini':
# uniq_suffix = str(int(mktime(datetime.datetime.now().timetuple())))
# REPO_TEST_PATH = '/tmp/hg_app_test_%s' % uniq_suffix
#
# if not os.path.isdir(REPO_TEST_PATH):
# os.mkdir(REPO_TEST_PATH)
# cur_dir = dn(os.path.abspath(__file__))
# tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
# tar.extractall(REPO_TEST_PATH)
# tar.close()
#
# tests = True
dbmanage = DbManage(log_sql, dbname, tests)
dbmanage.create_tables(override=True)
dbmanage.config_prompt(REPO_TEST_PATH)
dbmanage.create_default_user()
dbmanage.admin_prompt()
dbmanage.create_permissions()
dbmanage.populate_default_permissions()
load_environment(conf.global_conf, conf.local_conf, initial=True)
|