Mercurial > kallithea
comparison rhodecode/controllers/summary.py @ 763:0dad296d2a57 beta
extended trending languages to more entries, implemented new faster and "fancy"
method of extensions recognition.
Fixed small bug in indexer when data dir was empty
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 26 Nov 2010 02:25:39 +0100 |
parents | 49eb69d78988 |
children | e41aacb6aa18 |
comparison
equal
deleted
inserted
replaced
762:6e8322c438ca | 763:0dad296d2a57 |
---|---|
1 #!/usr/bin/env python | 1 # -*- coding: utf-8 -*- |
2 # encoding: utf-8 | 2 """ |
3 # summary controller for pylons | 3 package.rhodecode.controllers.summary |
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | 4 ~~~~~~~~~~~~~~ |
5 # | 5 |
6 Summary controller for Rhodecode | |
7 :created_on: Apr 18, 2010 | |
8 :author: marcink | |
9 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> | |
10 :license: GPLv3, see COPYING for more details. | |
11 """ | |
6 # This program is free software; you can redistribute it and/or | 12 # This program is free software; you can redistribute it and/or |
7 # modify it under the terms of the GNU General Public License | 13 # modify it under the terms of the GNU General Public License |
8 # as published by the Free Software Foundation; version 2 | 14 # as published by the Free Software Foundation; version 2 |
9 # of the License or (at your opinion) any later version of the license. | 15 # of the License or (at your opinion) any later version of the license. |
10 # | 16 # |
15 # | 21 # |
16 # You should have received a copy of the GNU General Public License | 22 # You should have received a copy of the GNU General Public License |
17 # along with this program; if not, write to the Free Software | 23 # along with this program; if not, write to the Free Software |
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
19 # MA 02110-1301, USA. | 25 # MA 02110-1301, USA. |
20 """ | 26 |
21 Created on April 18, 2010 | |
22 summary controller for pylons | |
23 @author: marcink | |
24 """ | |
25 from pylons import tmpl_context as c, request, url | 27 from pylons import tmpl_context as c, request, url |
26 from vcs.exceptions import ChangesetError | 28 from vcs.exceptions import ChangesetError |
27 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator | 29 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
28 from rhodecode.lib.base import BaseController, render | 30 from rhodecode.lib.base import BaseController, render |
29 from rhodecode.lib.utils import OrderedDict, EmptyChangeset | 31 from rhodecode.lib.utils import OrderedDict, EmptyChangeset |
114 lang_stats = json.loads(stats.languages) | 116 lang_stats = json.loads(stats.languages) |
115 c.commit_data = stats.commit_activity | 117 c.commit_data = stats.commit_activity |
116 c.overview_data = stats.commit_activity_combined | 118 c.overview_data = stats.commit_activity_combined |
117 c.trending_languages = json.dumps(OrderedDict( | 119 c.trending_languages = json.dumps(OrderedDict( |
118 sorted(lang_stats.items(), reverse=True, | 120 sorted(lang_stats.items(), reverse=True, |
119 key=lambda k: k[1])[:2] | 121 key=lambda k: k[1])[:10] |
120 ) | 122 ) |
121 ) | 123 ) |
122 else: | 124 else: |
123 c.commit_data = json.dumps({}) | 125 c.commit_data = json.dumps({}) |
124 c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 0] ]) | 126 c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 0] ]) |