Permalink
Browse files

switch over to json from simplejson

  • Loading branch information...
1 parent 05c16c5 commit beecabc1e447b4ee8c05d098bb9bae176978e2fe @avsm committed Apr 16, 2010
Showing with 8 additions and 7 deletions.
  1. +2 −2 Clue.py
  2. +3 −2 extractors/Extractor.py
  3. +1 −1 main.py
  4. +2 −2 providers/DopplrProvider.py
View
@@ -4,7 +4,7 @@
import re
from time import time, gmtime
from urllib import quote
-import simplejson
+import json
from Utilities import *
@@ -96,7 +96,7 @@ def getMoreUrls( self ):
# callback from Google Social call
def gotSocialGraphData( self, raw, isStale ):
try:
- data = simplejson.loads( raw )
+ data = json.loads( raw )
except ValueError:
return # meh
urls = data['nodes'].keys()
View
@@ -12,7 +12,7 @@
from HTMLParser import HTMLParseError
import urllib, urlparse, urllib2
from urllib import quote
-import simplejson
+import json
import Cache
from Utilities import *
@@ -32,6 +32,7 @@ def getClue( self, caller ):
self.clues() # implemented in subclasses. Calls addClues
def addClues( self, clues, more_urls = [] ):
+ print_info("addClues: %s %s" % (str(clues), str(more_urls)))
if clues and self.caller:
print_info("found a clue!")
clues[0].addExtraUrls( more_urls )
@@ -207,7 +208,7 @@ def getSocialGraphFor( self, url, more_urls = [] ):
def gotSocialGraphData( self, raw, isStale ):
try:
- data = simplejson.loads( raw )
+ data = json.loads( raw )
except ValueError:
return # meh
original_url = data['canonical_mapping'].keys()[0]
View
@@ -15,7 +15,7 @@
# put external deps here where py2app can find them
import PyObjCTools
import WebKit
-import simplejson
+import json
import urllib2
import sgmllib
import cgi
@@ -1,7 +1,7 @@
from Provider import *
import urllib
import re
-import simplejson
+import json
from datetime import datetime
from time import time, strftime, gmtime
import feedparser # can parse iso8601 dates
@@ -31,7 +31,7 @@ def failed(self, error):
def gotDopplrData(self, data, stale):
self.stale = stale
try:
- doc = simplejson.loads( data )
+ doc = json.loads( data )
self.response = doc['traveller']
except ValueError, e:
print(e)

0 comments on commit beecabc

Please sign in to comment.