do safe simplejson import in common and use this imported copy in the 2

other places where its used.
This commit is contained in:
Damien Churchill 2009-02-19 09:39:18 +00:00
parent 8c2b735a8b
commit 70a810b531
3 changed files with 9 additions and 12 deletions

View File

@ -29,6 +29,12 @@ import os
import time import time
import subprocess import subprocess
import platform import platform
import sys
if sys.version_info > (2, 6):
import json
else:
import simplejson as json
import pkg_resources import pkg_resources
import xdg, xdg.BaseDirectory import xdg, xdg.BaseDirectory

View File

@ -30,16 +30,12 @@ Deluge Config Module
import cPickle as pickle import cPickle as pickle
import shutil import shutil
import os import os
import sys
if sys.version_info > (2, 6):
import json
else:
import simplejson as json
import deluge.common import deluge.common
from deluge.log import LOG as log from deluge.log import LOG as log
json = deluge.common.json
def prop(func): def prop(func):
"""Function decorator for defining property attributes """Function decorator for defining property attributes

View File

@ -23,7 +23,6 @@
# #
import os import os
import sys
import time import time
import locale import locale
import shutil import shutil
@ -34,11 +33,6 @@ import logging
import tempfile import tempfile
import pkg_resources import pkg_resources
if sys.version_info > (2, 6):
import json
else:
import simplejson as json
from twisted.application import service, internet from twisted.application import service, internet
from twisted.internet.defer import Deferred from twisted.internet.defer import Deferred
from twisted.web import http, resource, server, static from twisted.web import http, resource, server, static
@ -52,6 +46,7 @@ from deluge.ui import common as uicommon
from deluge.ui.client import client, Client from deluge.ui.client import client, Client
from deluge.ui.tracker_icons import TrackerIcons from deluge.ui.tracker_icons import TrackerIcons
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
json = common.json
# Initialize gettext # Initialize gettext
try: try: