jenkins-bot has submitted this change and it was merged.
Change subject: Install simplejson workaround for 2.5 ......................................................................
Install simplejson workaround for 2.5
It is still easy to use Python 2.5 if needed (that's my case, unfortunately).
Change-Id: I270cc75fc0756a3810023b7022b6c517e39a97f9 --- M data_ingestion.py M generate_family_file.py M pagegenerators.py M panoramiopicker.py M query.py M wikipedia.py 6 files changed, 27 insertions(+), 7 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/data_ingestion.py b/data_ingestion.py index e1376b6..f5c8f3d 100644 --- a/data_ingestion.py +++ b/data_ingestion.py @@ -8,7 +8,11 @@ import posixpath, urlparse import urllib import hashlib, base64 -import StringIO, json +import StringIO +try: + import json +except ImportError: + import simplejson as json
class Photo(object): ''' diff --git a/generate_family_file.py b/generate_family_file.py index cfba6f9..1607ead 100644 --- a/generate_family_file.py +++ b/generate_family_file.py @@ -50,7 +50,10 @@ # parsing response data from BeautifulSoup import BeautifulSoup
-import json +try: + import json +except ImportError: + import simplejson as json
class FamilyFileGenerator(object): def __init__(self, url=None, name=None, dointerwiki=None): diff --git a/pagegenerators.py b/pagegenerators.py index 79b38d6..2629068 100644 --- a/pagegenerators.py +++ b/pagegenerators.py @@ -940,7 +940,10 @@ # yield url
def queryViaAPI(self, query): - import json + try: + import json + except ImportError: + import simplejson as json url = u'http://ajax.googleapis.com/ajax/services/search/web?' params = { 'key': config.google_key, diff --git a/panoramiopicker.py b/panoramiopicker.py index b75cada..be8376f 100644 --- a/panoramiopicker.py +++ b/panoramiopicker.py @@ -25,7 +25,11 @@ import imagerecat import upload import externals # check for and install needed -import json +try: + import json +except ImportError: + import simplejson as json + from Tkinter import * from PIL import Image, ImageTk # see: http://www.pythonware.com/products/pil/ from BeautifulSoup import BeautifulSoup diff --git a/query.py b/query.py index a249b83..8b36962 100644 --- a/query.py +++ b/query.py @@ -29,8 +29,10 @@ import wikipedia as pywikibot import config from pywikibot.support import deprecate_arg -import json - +try: + import json +except ImportError: + import simplejson as json
@deprecate_arg("encodeTitle", None) def GetData(params, site=None, useAPI=True, retryCount=config.maxretries, diff --git a/wikipedia.py b/wikipedia.py index d0d8488..050e825 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -162,7 +162,11 @@ import weakref import logging import logging.handlers -import json +try: + import json +except ImportError: + import simplejson as json + # Splitting the bot into library parts from pywikibot.support import * import config