Mercurial > kallithea
diff rhodecode/controllers/summary.py @ 1514:87ec80c280bb beta
fixed issues with python2.5
added compat module to rhodecode to have one point of fetching backward incompatible libs.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 07 Oct 2011 02:51:18 +0200 |
parents | 182f5bd3b49d |
children | da8f1d1b22de df59c0503636 |
line wrap: on
line diff
--- a/rhodecode/controllers/summary.py Wed Oct 05 00:10:42 2011 +0200 +++ b/rhodecode/controllers/summary.py Fri Oct 07 02:51:18 2011 +0200 @@ -39,19 +39,13 @@ from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator from rhodecode.lib.base import BaseRepoController, render from rhodecode.lib.utils import EmptyChangeset -from rhodecode.lib.odict import OrderedDict from rhodecode.lib.celerylib import run_task from rhodecode.lib.celerylib.tasks import get_commits_stats, \ LANGUAGES_EXTENSIONS_MAP from rhodecode.lib.helpers import RepoPage +from rhodecode.lib.compat import json, OrderedDict -try: - import json -except ImportError: - #python 2.5 compatibility - import simplejson as json - log = logging.getLogger(__name__) @@ -139,7 +133,7 @@ lang_stats_d = json.loads(stats.languages) c.commit_data = stats.commit_activity c.overview_data = stats.commit_activity_combined - + lang_stats = ((x, {"count": y, "desc": LANGUAGES_EXTENSIONS_MAP.get(x)}) for x, y in lang_stats_d.items()) @@ -162,7 +156,7 @@ c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 10]]) c.trending_languages = json.dumps({}) c.no_data = True - + c.enable_downloads = dbrepo.enable_downloads if c.enable_downloads: c.download_options = self._get_download_links(c.rhodecode_repo)