##// END OF EJS Templates
Added initial query skipp when seting up the app....
marcink -
r365:ec7b76d4 default
parent child Browse files
Show More
@@ -15,7 +15,7 b' import pylons_app.lib.helpers'
15
15
16 log = logging.getLogger(__name__)
16 log = logging.getLogger(__name__)
17
17
18 def load_environment(global_conf, app_conf):
18 def load_environment(global_conf, app_conf, initial=False):
19 """Configure the Pylons environment via the ``pylons.config``
19 """Configure the Pylons environment via the ``pylons.config``
20 object
20 object
21 """
21 """
@@ -63,7 +63,7 b' def load_environment(global_conf, app_co'
63 init_model(sa_engine_db1)
63 init_model(sa_engine_db1)
64 config['pylons.app_globals'].baseui = make_ui('db')
64 config['pylons.app_globals'].baseui = make_ui('db')
65
65
66 repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals']))
66 repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'], initial))
67 set_available_permissions(config)
67 set_available_permissions(config)
68 set_base_path(config)
68 set_base_path(config)
69 set_hg_app_config(config)
69 set_hg_app_config(config)
@@ -16,6 +16,11 b''
16 # along with this program; if not, write to the Free Software
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA 02110-1301, USA.
18 # MA 02110-1301, USA.
19 """
20 Created on April 7, 2010
21 admin controller for pylons
22 @author: marcink
23 """
19 from formencode import htmlfill
24 from formencode import htmlfill
20 from operator import itemgetter
25 from operator import itemgetter
21 from pylons import request, response, session, tmpl_context as c, url
26 from pylons import request, response, session, tmpl_context as c, url
@@ -31,11 +36,8 b' from pylons_app.model.repo_model import '
31 import formencode
36 import formencode
32 import logging
37 import logging
33 import traceback
38 import traceback
34 """
39 from paste.httpexceptions import HTTPInternalServerError
35 Created on April 7, 2010
40
36 admin controller for pylons
37 @author: marcink
38 """
39 log = logging.getLogger(__name__)
41 log = logging.getLogger(__name__)
40
42
41 class ReposController(BaseController):
43 class ReposController(BaseController):
@@ -130,7 +132,6 b' class ReposController(BaseController):'
130 h.flash(_('error occured during update of repository %s') \
132 h.flash(_('error occured during update of repository %s') \
131 % repo_name, category='error')
133 % repo_name, category='error')
132
134
133
134 return redirect(url('edit_repo', repo_name=changed_name))
135 return redirect(url('edit_repo', repo_name=changed_name))
135
136
136 def delete(self, repo_name):
137 def delete(self, repo_name):
@@ -174,7 +175,7 b' class ReposController(BaseController):'
174 except Exception as e:
175 except Exception as e:
175 h.flash(_('An error occured during deletion of repository user'),
176 h.flash(_('An error occured during deletion of repository user'),
176 category='error')
177 category='error')
177
178 raise HTTPInternalServerError()
178
179
179 def show(self, repo_name, format='html'):
180 def show(self, repo_name, format='html'):
180 """GET /repos/repo_name: Show a specific item"""
181 """GET /repos/repo_name: Show a specific item"""
@@ -72,7 +72,6 b' class SummaryController(BaseController):'
72 def __get_commit_stats(self, repo):
72 def __get_commit_stats(self, repo):
73 aggregate = OrderedDict()
73 aggregate = OrderedDict()
74
74
75
76 #graph range
75 #graph range
77 td = datetime.today()
76 td = datetime.today()
78 y = td.year
77 y = td.year
@@ -80,23 +79,7 b' class SummaryController(BaseController):'
80 d = td.day
79 d = td.day
81 c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, d, 0, 0, 0, 0, 0, 0,))
80 c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, d, 0, 0, 0, 0, 0, 0,))
82 c.ts_max = mktime((y, m, d, 0, 0, 0, 0, 0, 0,))
81 c.ts_max = mktime((y, m, d, 0, 0, 0, 0, 0, 0,))
83
82
84
85 # #generate this monhts keys
86 # dates_range = OrderedDict()
87 # year_range = range(2010, datetime.today().year + 1)
88 # month_range = range(1, datetime.today().month + 1)
89 #
90 #
91 #
92 # for y in year_range:
93 # for m in month_range:
94 # for d in range(1, calendar.mdays[m] + 1):
95 # k = '%s-%s-%s' % (y, m, d)
96 # timetupple = [int(x) for x in k.split('-')]
97 # timetupple.extend([0 for _ in xrange(6)])
98 # k = mktime(timetupple)
99 # dates_range[k] = 0
100
83
101 def author_key_cleaner(k):
84 def author_key_cleaner(k):
102 k = person(k)
85 k = person(k)
@@ -19,5 +19,5 b' def setup_app(command, conf, vars):'
19 dbmanage.config_prompt()
19 dbmanage.config_prompt()
20 dbmanage.admin_prompt()
20 dbmanage.admin_prompt()
21 dbmanage.create_permissions()
21 dbmanage.create_permissions()
22 load_environment(conf.global_conf, conf.local_conf)
22 load_environment(conf.global_conf, conf.local_conf, initial=True)
23
23
General Comments 0
You need to be logged in to leave comments. Login now