Mercurial > kallithea
annotate rhodecode/websetup.py @ 1100:e7d7f05217c1 beta
replaced all decode('utf-8') instances with .decode('utf-8','replace') for more error prof setup,
this way rhodecode could handle displaying non utf8 encoded file paths. This is still an invalid path, but this way we could at least show those paths without errors
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 27 Feb 2011 02:43:44 +0100 |
parents | 44661d2a7b61 |
children | 6832ef664673 |
rev | line source |
---|---|
841
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
1 # -*- coding: utf-8 -*- |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
2 """ |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
3 rhodecode.websetup |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
4 ~~~~~~~~~~~~~~~~~~ |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
5 |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
6 Weboperations and setup for rhodecode |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
7 |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
8 :created_on: Dec 11, 2010 |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
9 :author: marcink |
902
07a6e8c65526
fixed copyright year to 2011
Marcin Kuzminski <marcin@python-works.com>
parents:
841
diff
changeset
|
10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> |
841
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
11 :license: GPLv3, see COPYING for more details. |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
12 """ |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
13 # This program is free software; you can redistribute it and/or |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
14 # modify it under the terms of the GNU General Public License |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
15 # as published by the Free Software Foundation; version 2 |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
16 # of the License or (at your opinion) any later version of the license. |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
17 # |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
18 # This program is distributed in the hope that it will be useful, |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
21 # GNU General Public License for more details. |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
22 # |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
23 # You should have received a copy of the GNU General Public License |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
24 # along with this program; if not, write to the Free Software |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
26 # MA 02110-1301, USA. |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
27 |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
28 import os |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
29 import logging |
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
30 |
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
491
diff
changeset
|
31 from rhodecode.config.environment import load_environment |
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
491
diff
changeset
|
32 from rhodecode.lib.db_manage import DbManage |
841
78b3d2d730f2
fixed import problems
Marcin Kuzminski <marcin@python-works.com>
parents:
834
diff
changeset
|
33 |
469
e94f4e54dc03
tests fix, put vcs testing tarball
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
34 |
0 | 35 log = logging.getLogger(__name__) |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
469
diff
changeset
|
36 |
0 | 37 def setup_app(command, conf, vars): |
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
491
diff
changeset
|
38 """Place any commands to setup rhodecode here""" |
781
7ae66bddf48d
fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
555
diff
changeset
|
39 dbconf = conf['sqlalchemy.db1.url'] |
7ae66bddf48d
fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
555
diff
changeset
|
40 dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], tests=False) |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
41 dbmanage.create_tables(override=True) |
834
8924ed0e4f36
added current db version into rhodecode,
Marcin Kuzminski <marcin@python-works.com>
parents:
781
diff
changeset
|
42 dbmanage.set_db_version() |
1094
44661d2a7b61
fixes #120 websetup command runs os.access on given path checking for write access
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
43 dbmanage.create_settings(dbmanage.config_prompt(None)) |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
417
diff
changeset
|
44 dbmanage.create_default_user() |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
45 dbmanage.admin_prompt() |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
46 dbmanage.create_permissions() |
417
3ed2d46a2ca7
permission refactoring,
Marcin Kuzminski <marcin@python-works.com>
parents:
365
diff
changeset
|
47 dbmanage.populate_default_permissions() |
781
7ae66bddf48d
fixed db manage, to work on other databases than sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
555
diff
changeset
|
48 |
555
03676d39dd0a
added fault tolerant case when celeryconfig is not present in the directory.
Marcin Kuzminski <marcin@python-works.com>
parents:
552
diff
changeset
|
49 load_environment(conf.global_conf, conf.local_conf, initial=True) |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
50 |
552
2642f128ad46
removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
51 |
2642f128ad46
removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
52 |
2642f128ad46
removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
53 |
2642f128ad46
removed egg info, update files for distutils build
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
54 |