##// END OF EJS Templates
fixes #37 python import on json
marcink -
r608:101e07f8 default
parent child Browse files
Show More
@@ -22,7 +22,11 b' Created on April 21, 2010'
22 22 changelog controller for pylons
23 23 @author: marcink
24 24 """
25 from json import dumps
25 try:
26 import json
27 except ImportError:
28 #python 2.5 compatibility
29 import simplejson as json
26 30 from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev
27 31 from pylons import request, session, tmpl_context as c
28 32 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
@@ -69,7 +73,7 b' class ChangelogController(BaseController'
69 73
70 74 def _graph(self, repo, size, p):
71 75 revcount = size
72 if not repo.revisions:return dumps([]), 0
76 if not repo.revisions:return json.dumps([]), 0
73 77
74 78 max_rev = repo.revisions[-1]
75 79 offset = 1 if p == 1 else ((p - 1) * revcount + 1)
@@ -86,5 +90,5 b' class ChangelogController(BaseController'
86 90 continue
87 91 data.append(('', vtx, edges))
88 92
89 c.jsdata = dumps(data)
93 c.jsdata = json.dumps(data)
90 94
@@ -35,7 +35,11 b' from datetime import datetime, timedelta'
35 35 from time import mktime
36 36 import calendar
37 37 import logging
38 import json
38 try:
39 import json
40 except ImportError:
41 #python 2.5 compatibility
42 import simplejson as json
39 43 log = logging.getLogger(__name__)
40 44
41 45 class SummaryController(BaseController):
General Comments 0
You need to be logged in to leave comments. Login now