summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Leray <alexandre@alexandreleray.com>2010-11-04 19:03:32 (GMT)
committer Alexandre Leray <alexandre@alexandreleray.com>2010-11-04 19:03:32 (GMT)
commit5e0613e847c69be019f1c6756581ce1ec73a85a0 (patch)
tree4e8eca660b36504d14f53f01e0f44b70f8be9ee8
parent79a5713754e4355a1287dc10f80ffe596fa39f72 (diff)
Fixed json import statement to fallback to simplejson
-rwxr-xr-xbrainch/models/actions.py5
-rwxr-xr-xbrainch/views/repositories/clone.py5
-rwxr-xr-xbrainch/views/repositories/create.py5
-rwxr-xr-xbrainch/views/repositories/edit.py5
-rwxr-xr-xbrainch/views/repositories/pull.py5
-rwxr-xr-xbrainch/views/repositories/pull_request.py7
6 files changed, 25 insertions, 7 deletions
diff --git a/brainch/models/actions.py b/brainch/models/actions.py
index 41633bc..9e10029 100755
--- a/brainch/models/actions.py
+++ b/brainch/models/actions.py
@@ -15,7 +15,10 @@
## along with Brainch. If not, see <http://www.gnu.org/licenses/>.
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
from django.db import models
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
diff --git a/brainch/views/repositories/clone.py b/brainch/views/repositories/clone.py
index 96f4ca3..98b913a 100755
--- a/brainch/views/repositories/clone.py
+++ b/brainch/views/repositories/clone.py
@@ -15,7 +15,10 @@
## along with Brainch. If not, see <http://www.gnu.org/licenses/>.
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
from datetime import datetime
from textwrap import dedent
from django.db import IntegrityError
diff --git a/brainch/views/repositories/create.py b/brainch/views/repositories/create.py
index 245ae46..4b04c35 100755
--- a/brainch/views/repositories/create.py
+++ b/brainch/views/repositories/create.py
@@ -15,7 +15,10 @@
## along with Brainch. If not, see <http://www.gnu.org/licenses/>.
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
import os
from datetime import datetime
from textwrap import dedent
diff --git a/brainch/views/repositories/edit.py b/brainch/views/repositories/edit.py
index ed8ed21..1f3e083 100755
--- a/brainch/views/repositories/edit.py
+++ b/brainch/views/repositories/edit.py
@@ -16,7 +16,10 @@
import cStringIO
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
from ConfigParser import ConfigParser
from datetime import datetime
from textwrap import dedent
diff --git a/brainch/views/repositories/pull.py b/brainch/views/repositories/pull.py
index e5de2eb..f6e7ab5 100755
--- a/brainch/views/repositories/pull.py
+++ b/brainch/views/repositories/pull.py
@@ -15,7 +15,10 @@
## along with Brainch. If not, see <http://www.gnu.org/licenses/>.
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
from datetime import datetime
from textwrap import dedent
from django.http import HttpResponseRedirect
diff --git a/brainch/views/repositories/pull_request.py b/brainch/views/repositories/pull_request.py
index c58e73b..68bb09f 100755
--- a/brainch/views/repositories/pull_request.py
+++ b/brainch/views/repositories/pull_request.py
@@ -15,6 +15,11 @@
## along with Brainch. If not, see <http://www.gnu.org/licenses/>.
+from datetime import datetime
+try:
+ import json
+except ImportError:
+ import simplejson as json
from textwrap import dedent
from django.contrib import messages
from django.template import RequestContext
@@ -23,8 +28,6 @@ from django.shortcuts import render_to_response
from brainch.views.utils import get_mate_repos
from brainch.forms import PullRequestForm
from brainch.models import UserAction, Repository
-from datetime import datetime
-import json
def pull_request(request, username, name):