Mercurial > public > src > rhodecode
diff pylons_app/websetup.py @ 517:6b934c9607e7 celery
Improved testing scenarios. Made test env creator
Fixed hg_model error message
some other tweeks and fixes
Models fixe for uniq email, and removed some extra not needed imports from model main module
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 13 Sep 2010 01:23:58 +0200 |
parents | e94f4e54dc03 |
children | fefffd6fd5f4 |
line wrap: on
line diff
--- a/pylons_app/websetup.py Sun Sep 12 22:42:03 2010 +0200 +++ b/pylons_app/websetup.py Mon Sep 13 01:23:58 2010 +0200 @@ -1,40 +1,38 @@ """Setup the pylons_app application""" -from os.path import dirname as dn, join as jn +from os.path import dirname as dn from pylons_app.config.environment import load_environment from pylons_app.lib.db_manage import DbManage -import datetime -from time import mktime import logging import os import sys -import tarfile 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 == 'tests.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 +# 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)