comparison rhodecode/lib/utils.py @ 783:71113f64b2d8 beta

fidex corrent variables passed to dnconfig, fixed celerylib import problem on tests
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 27 Nov 2010 20:32:34 +0100
parents 876776983c3c
children 277427ac29a9
comparison
equal deleted inserted replaced
782:51127b2efb33 783:71113f64b2d8
1 #!/usr/bin/env python 1 # -*- coding: utf-8 -*-
2 # encoding: utf-8 2 """
3 # Utilities for RhodeCode 3 package.rhodecode.lib.utils
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> 4 ~~~~~~~~~~~~~~
5
6 Utilities library for RhodeCode
7
8 :created_on: Apr 18, 2010
9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
12 """
5 # This program is free software; you can redistribute it and/or 13 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License 14 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; version 2 15 # as published by the Free Software Foundation; version 2
8 # of the License or (at your opinion) any later version of the license. 16 # of the License or (at your opinion) any later version of the license.
9 # 17 #
14 # 22 #
15 # You should have received a copy of the GNU General Public License 23 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software 24 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA 02110-1301, USA. 26 # MA 02110-1301, USA.
19 """ 27
20 Created on April 18, 2010 28 import os
21 Utilities for RhodeCode 29 import logging
22 @author: marcink 30 import datetime
23 """ 31 import traceback
32 import ConfigParser
24 33
25 from UserDict import DictMixin 34 from UserDict import DictMixin
35
26 from mercurial import ui, config, hg 36 from mercurial import ui, config, hg
27 from mercurial.error import RepoError 37 from mercurial.error import RepoError
38
39 from paste.script import command
40 from vcs.backends.base import BaseChangeset
41 from vcs.utils.lazy import LazyProperty
42
28 from rhodecode.model import meta 43 from rhodecode.model import meta
29 from rhodecode.model.caching_query import FromCache 44 from rhodecode.model.caching_query import FromCache
30 from rhodecode.model.db import Repository, User, RhodeCodeUi, UserLog 45 from rhodecode.model.db import Repository, User, RhodeCodeUi, UserLog
31 from rhodecode.model.repo import RepoModel 46 from rhodecode.model.repo import RepoModel
32 from rhodecode.model.user import UserModel 47 from rhodecode.model.user import UserModel
33
34 from vcs.backends.base import BaseChangeset
35 from paste.script import command
36 import ConfigParser
37 from vcs.utils.lazy import LazyProperty
38 import traceback
39 import datetime
40 import logging
41 import os
42 48
43 log = logging.getLogger(__name__) 49 log = logging.getLogger(__name__)
44 50
45 51
46 def get_repo_slug(request): 52 def get_repo_slug(request):
462 468
463 # add ch to logger 469 # add ch to logger
464 log.addHandler(ch) 470 log.addHandler(ch)
465 471
466 #PART ONE create db 472 #PART ONE create db
467 dbname = config['sqlalchemy.db1.url'].split('/')[-1] 473 dbconf = config['sqlalchemy.db1.url']
468 log.debug('making test db %s', dbname) 474 log.debug('making test db %s', dbconf)
469 475
470 dbmanage = DbManage(log_sql=True, dbname=dbname, root=config['here'], 476 dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=config['here'],
471 tests=True) 477 tests=True)
472 dbmanage.create_tables(override=True) 478 dbmanage.create_tables(override=True)
473 dbmanage.config_prompt(repos_test_path) 479 dbmanage.config_prompt(repos_test_path)
474 dbmanage.create_default_user() 480 dbmanage.create_default_user()
475 dbmanage.admin_prompt() 481 dbmanage.admin_prompt()