Skip to content
Browse files

Use the simplejson bundled with django

  • Loading branch information...
1 parent bb577a5 commit b3ac8aa0be8f12b913b8b74c6ec0be8ae6afa3b7 @coleifer coleifer committed Dec 26, 2010
Showing with 7 additions and 8 deletions.
  1. +1 −1 oembed/providers.py
  2. +2 −2 oembed/sites.py
  3. +1 −1 oembed/tests/tests/base.py
  4. +2 −2 oembed/tests/tests/sites.py
  5. +1 −2 oembed/tests/tests/views.py
View
2 oembed/providers.py
@@ -1,6 +1,5 @@
import datetime
import httplib2
-import simplejson
import re
import time
from urllib import urlencode
@@ -12,6 +11,7 @@
from django.db.models.fields.files import ImageField, ImageFieldFile
from django.template import RequestContext, Context
from django.template.loader import render_to_string, get_template
+from django.utils import simplejson
from oembed.constants import OEMBED_ALLOWED_SIZES, OEMBED_THUMBNAIL_SIZE
from oembed.exceptions import OEmbedException, OEmbedHTTPException
View
4 oembed/sites.py
@@ -1,10 +1,10 @@
import datetime
import re
-import simplejson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import signals
+from django.utils import simplejson as json
from oembed.constants import DEFAULT_OEMBED_TTL, MIN_OEMBED_TTL, RESOURCE_TYPES
from oembed.exceptions import AlreadyRegistered, NotRegistered, OEmbedMissingEndpoint, OEmbedException
@@ -180,7 +180,7 @@ def autodiscover(self, url):
"""
headers, response = fetch_url(url)
if headers['content-type'] in ('application/json', 'text/javascript'):
- provider_data = simplejson.loads(response)
+ provider_data = json.loads(response)
return self.store_providers(provider_data)
def store_providers(self, provider_data):
View
2 oembed/tests/tests/base.py
@@ -1,4 +1,3 @@
-import simplejson
import os
try:
@@ -9,6 +8,7 @@
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django.test import TestCase
+from django.utils import simplejson
import oembed
from oembed.providers import BaseProvider
View
4 oembed/tests/tests/sites.py
@@ -1,6 +1,6 @@
-import oembed
-import simplejson
+from django.utils import simplejson
+import oembed
from oembed.exceptions import AlreadyRegistered, NotRegistered, OEmbedMissingEndpoint
from oembed.models import StoredProvider, StoredOEmbed
from oembed.resources import OEmbedResource
View
3 oembed/tests/tests/views.py
@@ -1,7 +1,6 @@
-import simplejson
-
from django.conf import settings
from django.core.urlresolvers import reverse
+from django.utils import simplejson
import oembed
from oembed.models import StoredOEmbed, StoredProvider

0 comments on commit b3ac8aa

Please sign in to comment.
Something went wrong with that request. Please try again.