|
a/Allura/allura/websetup/bootstrap.py |
|
b/Allura/allura/websetup/bootstrap.py |
|
... |
|
... |
21 |
import os
|
21 |
import os
|
22 |
import sys
|
22 |
import sys
|
23 |
import logging
|
23 |
import logging
|
24 |
import shutil
|
24 |
import shutil
|
25 |
from collections import defaultdict
|
25 |
from collections import defaultdict
|
26 |
from datetime import datetime
|
26 |
from textwrap import dedent
|
27 |
|
27 |
|
28 |
import tg
|
28 |
import tg
|
29 |
from pylons import tmpl_context as c, app_globals as g
|
29 |
from pylons import tmpl_context as c, app_globals as g
|
30 |
from paste.deploy.converters import asbool
|
30 |
from paste.deploy.converters import asbool
|
31 |
|
31 |
|
|
... |
|
... |
37 |
from allura.lib import plugin
|
37 |
from allura.lib import plugin
|
38 |
from allura import model as M
|
38 |
from allura import model as M
|
39 |
from allura.websetup import schema
|
39 |
from allura.websetup import schema
|
40 |
from allura.command import EnsureIndexCommand
|
40 |
from allura.command import EnsureIndexCommand
|
41 |
from allura.command import CreateTroveCategoriesCommand
|
41 |
from allura.command import CreateTroveCategoriesCommand
|
|
|
42 |
|
|
|
43 |
from forgewiki import model as WM
|
42 |
|
44 |
|
43 |
log = logging.getLogger(__name__)
|
45 |
log = logging.getLogger(__name__)
|
44 |
|
46 |
|
45 |
def cache_test_data():
|
47 |
def cache_test_data():
|
46 |
log.info('Saving data to cache in .test-data')
|
48 |
log.info('Saving data to cache in .test-data')
|
|
... |
|
... |
119 |
assert tg.config['auth.method'] == 'local'
|
121 |
assert tg.config['auth.method'] == 'local'
|
120 |
project_reg = plugin.ProjectRegistrationProvider.get()
|
122 |
project_reg = plugin.ProjectRegistrationProvider.get()
|
121 |
p_projects = project_reg.register_neighborhood_project(n_projects, [root], allow_register=True)
|
123 |
p_projects = project_reg.register_neighborhood_project(n_projects, [root], allow_register=True)
|
122 |
p_users = project_reg.register_neighborhood_project(n_users, [root])
|
124 |
p_users = project_reg.register_neighborhood_project(n_users, [root])
|
123 |
p_adobe = project_reg.register_neighborhood_project(n_adobe, [root])
|
125 |
p_adobe = project_reg.register_neighborhood_project(n_adobe, [root])
|
|
|
126 |
|
|
|
127 |
def set_nbhd_wiki_content(nbhd_proj, content):
|
|
|
128 |
wiki = nbhd_proj.app_instance('wiki')
|
|
|
129 |
page = WM.Page.query.get(app_config_id=wiki.config._id, title=wiki.root_page_name)
|
|
|
130 |
page.text = content
|
|
|
131 |
|
|
|
132 |
set_nbhd_wiki_content(p_projects, dedent('''
|
|
|
133 |
Welcome to the "Projects" neighborhood. It is the default neighborhood in Allura.
|
|
|
134 |
You can edit this wiki page as you see fit. Here's a few ways to get started:
|
|
|
135 |
|
|
|
136 |
[Register a new project](/p/add_project)
|
|
|
137 |
|
|
|
138 |
[Neighborhood administration](/p/admin)
|
|
|
139 |
|
|
|
140 |
[[projects show_total=yes]]
|
|
|
141 |
'''))
|
|
|
142 |
set_nbhd_wiki_content(p_users, dedent('''
|
|
|
143 |
This is the "Users" neighborhood. All users automatically get a user-project created for them, using their username.
|
|
|
144 |
|
|
|
145 |
[Neighborhood administration](/u/admin)
|
|
|
146 |
|
|
|
147 |
[[projects show_total=yes]]
|
|
|
148 |
'''))
|
|
|
149 |
set_nbhd_wiki_content(p_adobe, dedent('''
|
|
|
150 |
This is the "Adobe" neighborhood. It is just an example of having projects in a different neighborhood.
|
|
|
151 |
|
|
|
152 |
[Neighborhood administration](/adobe/admin)
|
|
|
153 |
|
|
|
154 |
[[projects show_total=yes]]
|
|
|
155 |
'''))
|
|
|
156 |
|
124 |
ThreadLocalORMSession.flush_all()
|
157 |
ThreadLocalORMSession.flush_all()
|
125 |
ThreadLocalORMSession.close_all()
|
158 |
ThreadLocalORMSession.close_all()
|
126 |
|
159 |
|
127 |
# add the adobe icon
|
160 |
# add the adobe icon
|
128 |
file_name = 'adobe_icon.png'
|
161 |
file_name = 'adobe_icon.png'
|