annotate rhodecode/controllers/summary.py @ 810:bd57d1cb9dc3 beta

fixes #62, added option to disable statistics for each repository
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 05 Dec 2010 15:47:49 +0100
parents e41aacb6aa18
children de5d9de45146
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
763
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
1 # -*- coding: utf-8 -*-
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
2 """
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
3 package.rhodecode.controllers.summary
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
4 ~~~~~~~~~~~~~~
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
5
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
6 Summary controller for Rhodecode
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
7 :created_on: Apr 18, 2010
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
8 :author: marcink
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
9 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
10 :license: GPLv3, see COPYING for more details.
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
11 """
252
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
12 # This program is free software; you can redistribute it and/or
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
13 # modify it under the terms of the GNU General Public License
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
14 # as published by the Free Software Foundation; version 2
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
15 # of the License or (at your opinion) any later version of the license.
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
16 #
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
17 # This program is distributed in the hope that it will be useful,
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
20 # GNU General Public License for more details.
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
21 #
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
22 # You should have received a copy of the GNU General Public License
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
23 # along with this program; if not, write to the Free Software
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 245
diff changeset
25 # MA 02110-1301, USA.
763
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
26
810
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
27 import calendar
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
28 import logging
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
29 from time import mktime
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
30 from datetime import datetime, timedelta
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
31
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
32 from vcs.exceptions import ChangesetError
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
33
486
5c376ac2d4c9 rewrote graph plotting, added zooming and json dump insted of stupid string formating.
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
34 from pylons import tmpl_context as c, request, url
810
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
35 from pylons.i18n.translation import _
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
36
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
37 from rhodecode.model.scm import ScmModel
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
38 from rhodecode.model.db import Statistics
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
39
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 510
diff changeset
40 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 510
diff changeset
41 from rhodecode.lib.base import BaseController, render
643
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
42 from rhodecode.lib.utils import OrderedDict, EmptyChangeset
810
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
43
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 510
diff changeset
44 from rhodecode.lib.celerylib import run_task
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 510
diff changeset
45 from rhodecode.lib.celerylib.tasks import get_commits_stats
810
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
46
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
47 from webhelpers.paginate import Page
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
48
592
0a48c1ec04fc #37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
49 try:
0a48c1ec04fc #37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
50 import json
0a48c1ec04fc #37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
51 except ImportError:
0a48c1ec04fc #37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
52 #python 2.5 compatibility
0a48c1ec04fc #37 fixed json imports for python2.5
Marcin Kuzminski <marcin@python-works.com>
parents: 548
diff changeset
53 import simplejson as json
82
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
54 log = logging.getLogger(__name__)
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
55
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
56 class SummaryController(BaseController):
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
57
191
b68b2246e5a6 Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user.
Marcin Kuzminski <marcin@python-works.com>
parents: 127
diff changeset
58 @LoginRequired()
318
fdf9f6ee5217 Implemented permissions into hg app, secured admin controllers, templates and repository specific controllers
Marcin Kuzminski <marcin@python-works.com>
parents: 282
diff changeset
59 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
60 'repository.admin')
82
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
61 def __before__(self):
191
b68b2246e5a6 Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user.
Marcin Kuzminski <marcin@python-works.com>
parents: 127
diff changeset
62 super(SummaryController, self).__before__()
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
63
82
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
64 def index(self):
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
65 scm_model = ScmModel()
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
66 c.repo_info = scm_model.get_repo(c.repo_name)
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
67 c.following = scm_model.is_following_repo(c.repo_name,
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
68 c.rhodecode_user.user_id)
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
69 def url_generator(**kw):
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
70 return url('shortlog_home', repo_name=c.repo_name, **kw)
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
71
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
72 c.repo_changesets = Page(c.repo_info, page=1, items_per_page=10,
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
73 url=url_generator)
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
74
82
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
75 e = request.environ
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
76
674
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
77 if self.rhodecode_user.username == 'default':
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
78 password = ':default'
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
79 else:
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
80 password = ''
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
81
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
82 uri = u'%(protocol)s://%(user)s%(password)s@%(host)s%(prefix)s/%(repo_name)s' % {
232
37a832dc4a82 some beaker cache changes, and added repr to models
Marcin Kuzminski <marcin@python-works.com>
parents: 191
diff changeset
83 'protocol': e.get('wsgi.url_scheme'),
548
b75b77ef649d renamed hg_app to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
84 'user':str(c.rhodecode_user.username),
674
99875a8f2ad1 #49 Enabled anonymous access push and pull commands
Marcin Kuzminski <marcin@python-works.com>
parents: 643
diff changeset
85 'password':password,
232
37a832dc4a82 some beaker cache changes, and added repr to models
Marcin Kuzminski <marcin@python-works.com>
parents: 191
diff changeset
86 'host':e.get('HTTP_HOST'),
508
fdb78a140ae4 fixes #35 hg-app does not respect SCRIPT_NAME
Marcin Kuzminski <marcin@python-works.com>
parents: 506
diff changeset
87 'prefix':e.get('SCRIPT_NAME'),
232
37a832dc4a82 some beaker cache changes, and added repr to models
Marcin Kuzminski <marcin@python-works.com>
parents: 191
diff changeset
88 'repo_name':c.repo_name, }
191
b68b2246e5a6 Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user.
Marcin Kuzminski <marcin@python-works.com>
parents: 127
diff changeset
89 c.clone_repo_url = uri
389
174785aa5dc4 fixed sorting of tags and branches. Fix made in vcs.
Marcin Kuzminski <marcin@python-works.com>
parents: 365
diff changeset
90 c.repo_tags = OrderedDict()
277
7ec4463b6e53 fixed branches and tags, fetching for new vcs implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 252
diff changeset
91 for name, hash in c.repo_info.tags.items()[:10]:
643
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
92 try:
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
93 c.repo_tags[name] = c.repo_info.get_changeset(hash)
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
94 except ChangesetError:
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
95 c.repo_tags[name] = EmptyChangeset(hash)
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
96
389
174785aa5dc4 fixed sorting of tags and branches. Fix made in vcs.
Marcin Kuzminski <marcin@python-works.com>
parents: 365
diff changeset
97 c.repo_branches = OrderedDict()
277
7ec4463b6e53 fixed branches and tags, fetching for new vcs implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 252
diff changeset
98 for name, hash in c.repo_info.branches.items()[:10]:
643
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
99 try:
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
100 c.repo_branches[name] = c.repo_info.get_changeset(hash)
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
101 except ChangesetError:
9dc1d92d82ed updated setup for all newest versions
Marcin Kuzminski <marcin@python-works.com>
parents: 637
diff changeset
102 c.repo_branches[name] = EmptyChangeset(hash)
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
103
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
104 td = datetime.today() + timedelta(days=1)
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
105 y, m, d = td.year, td.month, td.day
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
106
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
107 ts_min_y = mktime((y - 1, (td - timedelta(days=calendar.mdays[m])).month,
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
108 d, 0, 0, 0, 0, 0, 0,))
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
109 ts_min_m = mktime((y, (td - timedelta(days=calendar.mdays[m])).month,
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
110 d, 0, 0, 0, 0, 0, 0,))
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
111
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
112 ts_max_y = mktime((y, m, d, 0, 0, 0, 0, 0, 0,))
810
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
113 if c.repo_info.dbrepo.enable_statistics:
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
114 c.no_data_msg = _('No data loaded yet')
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
115 run_task(get_commits_stats, c.repo_info.name, ts_min_y, ts_max_y)
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
116 else:
bd57d1cb9dc3 fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents: 800
diff changeset
117 c.no_data_msg = _('Statistics are disabled for this repository')
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
118 c.ts_min = ts_min_m
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
119 c.ts_max = ts_max_y
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
120
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
121 stats = self.sa.query(Statistics)\
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
122 .filter(Statistics.repository == c.repo_info.dbrepo)\
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
123 .scalar()
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
124
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
125
506
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
126 if stats and stats.languages:
800
e41aacb6aa18 small fixes for summary graph, added message about no data for the graph, when empty
Marcin Kuzminski <marcin@python-works.com>
parents: 763
diff changeset
127 c.no_data = False
506
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
128 lang_stats = json.loads(stats.languages)
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
129 c.commit_data = stats.commit_activity
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
130 c.overview_data = stats.commit_activity_combined
506
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
131 c.trending_languages = json.dumps(OrderedDict(
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
132 sorted(lang_stats.items(), reverse=True,
763
0dad296d2a57 extended trending languages to more entries, implemented new faster and "fancy"
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
133 key=lambda k: k[1])[:10]
506
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
134 )
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
135 )
493
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
136 else:
2256c78afe53 implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents: 486
diff changeset
137 c.commit_data = json.dumps({})
800
e41aacb6aa18 small fixes for summary graph, added message about no data for the graph, when empty
Marcin Kuzminski <marcin@python-works.com>
parents: 763
diff changeset
138 c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 10] ])
506
d5efb83590ef fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents: 493
diff changeset
139 c.trending_languages = json.dumps({})
800
e41aacb6aa18 small fixes for summary graph, added message about no data for the graph, when empty
Marcin Kuzminski <marcin@python-works.com>
parents: 763
diff changeset
140 c.no_data = True
637
b04d5214fd3c removed shortlog from main menu, as duplicated functionality of changelog,
Marcin Kuzminski <marcin@python-works.com>
parents: 629
diff changeset
141
191
b68b2246e5a6 Authenticated controller with LoginRequired decorator, and cleaned __before__ (used in baseController now). fixed User for clone url with logged in session user.
Marcin Kuzminski <marcin@python-works.com>
parents: 127
diff changeset
142 return render('summary/summary.html')
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 318
diff changeset
143