##// END OF EJS Templates
fidex corrent variables passed to dnconfig,...
marcink -
r783:71113f64 beta
parent child Browse files
Show More
@@ -1,13 +1,42 b''
1 # -*- coding: utf-8 -*-
2 """
3 package.rhodecode.lib.celerylib.__init__
4 ~~~~~~~~~~~~~~
5
6 celery libs for RhodeCode
7
8 :created_on: Nov 27, 2010
9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
12 """
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License
15 # as published by the Free Software Foundation; version 2
16 # of the License or (at your opinion) any later version of the license.
17 #
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 # MA 02110-1301, USA.
27
1 import os
28 import os
2 import sys
29 import sys
3 import socket
30 import socket
4 import traceback
31 import traceback
5 import logging
32 import logging
6
33
7 from rhodecode.lib.pidlock import DaemonLock, LockHeld
34 from hashlib import md5
35 from decorator import decorator
8 from vcs.utils.lazy import LazyProperty
36 from vcs.utils.lazy import LazyProperty
9 from decorator import decorator
37
10 from hashlib import md5
38 from rhodecode.lib.pidlock import DaemonLock, LockHeld
39
11 from pylons import config
40 from pylons import config
12
41
13 log = logging.getLogger(__name__)
42 log = logging.getLogger(__name__)
@@ -15,7 +44,10 b' log = logging.getLogger(__name__)'
15 def str2bool(v):
44 def str2bool(v):
16 return v.lower() in ["yes", "true", "t", "1"] if v else None
45 return v.lower() in ["yes", "true", "t", "1"] if v else None
17
46
18 CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
47 try:
48 CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
49 except KeyError:
50 CELERY_ON = False
19
51
20 class ResultWrapper(object):
52 class ResultWrapper(object):
21 def __init__(self, task):
53 def __init__(self, task):
@@ -1,7 +1,15 b''
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
@@ -16,30 +24,28 b''
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
48
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
43 log = logging.getLogger(__name__)
49 log = logging.getLogger(__name__)
44
50
45
51
@@ -464,10 +470,10 b' def create_test_env(repos_test_path, con'
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)
General Comments 0
You need to be logged in to leave comments. Login now