# HG changeset patch # User Marcin Kuzminski # Date 2010-10-12 11:03:14 # Node ID 101e07f82f2286e35e7b3235de0cc89d4a9a9a92 # Parent 1e2adb37cab6b731fb0bda1188d5be4b0f7a7a96 fixes #37 python import on json diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -22,7 +22,11 @@ Created on April 21, 2010 changelog controller for pylons @author: marcink """ -from json import dumps +try: + import json +except ImportError: + #python 2.5 compatibility + import simplejson as json from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev from pylons import request, session, tmpl_context as c from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator @@ -69,7 +73,7 @@ class ChangelogController(BaseController def _graph(self, repo, size, p): revcount = size - if not repo.revisions:return dumps([]), 0 + if not repo.revisions:return json.dumps([]), 0 max_rev = repo.revisions[-1] offset = 1 if p == 1 else ((p - 1) * revcount + 1) @@ -86,5 +90,5 @@ class ChangelogController(BaseController continue data.append(('', vtx, edges)) - c.jsdata = dumps(data) + c.jsdata = json.dumps(data) diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -35,7 +35,11 @@ from datetime import datetime, timedelta from time import mktime import calendar import logging -import json +try: + import json +except ImportError: + #python 2.5 compatibility + import simplejson as json log = logging.getLogger(__name__) class SummaryController(BaseController):