##// 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 changelog controller for pylons
22 changelog controller for pylons
23 @author: marcink
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 from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev
30 from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev
27 from pylons import request, session, tmpl_context as c
31 from pylons import request, session, tmpl_context as c
28 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
32 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
@@ -69,7 +73,7 b' class ChangelogController(BaseController'
69
73
70 def _graph(self, repo, size, p):
74 def _graph(self, repo, size, p):
71 revcount = size
75 revcount = size
72 if not repo.revisions:return dumps([]), 0
76 if not repo.revisions:return json.dumps([]), 0
73
77
74 max_rev = repo.revisions[-1]
78 max_rev = repo.revisions[-1]
75 offset = 1 if p == 1 else ((p - 1) * revcount + 1)
79 offset = 1 if p == 1 else ((p - 1) * revcount + 1)
@@ -86,5 +90,5 b' class ChangelogController(BaseController'
86 continue
90 continue
87 data.append(('', vtx, edges))
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 from time import mktime
35 from time import mktime
36 import calendar
36 import calendar
37 import logging
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 log = logging.getLogger(__name__)
43 log = logging.getLogger(__name__)
40
44
41 class SummaryController(BaseController):
45 class SummaryController(BaseController):
General Comments 0
You need to be logged in to leave comments. Login now