From 6be80318adc9f1323b0b83651107810ac481511e Mon Sep 17 00:00:00 2001 From: drebs Date: Sat, 25 May 2013 10:39:32 -0300 Subject: Enforce dependency on simplejson. --- src/leap/soledad/backends/couch.py | 5 +---- src/leap/soledad/backends/leap_backend.py | 5 +---- src/leap/soledad/server.py | 5 +---- src/leap/soledad/shared_db.py | 5 +---- src/leap/soledad/tests/test_couch.py | 5 +---- src/leap/soledad/tests/test_crypto.py | 5 +---- src/leap/soledad/tests/test_leap_backend.py | 6 ++---- src/leap/soledad/tests/test_server.py | 5 +---- src/leap/soledad/tests/test_soledad.py | 5 +---- src/leap/soledad/tests/test_sqlcipher.py | 7 +++---- 10 files changed, 13 insertions(+), 40 deletions(-) (limited to 'src/leap/soledad') diff --git a/src/leap/soledad/backends/couch.py b/src/leap/soledad/backends/couch.py index 93279e2e..0b9bff01 100644 --- a/src/leap/soledad/backends/couch.py +++ b/src/leap/soledad/backends/couch.py @@ -21,10 +21,7 @@ # general imports import uuid import re -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json from base64 import b64encode, b64decode diff --git a/src/leap/soledad/backends/leap_backend.py b/src/leap/soledad/backends/leap_backend.py index bb8ee548..4af2489b 100644 --- a/src/leap/soledad/backends/leap_backend.py +++ b/src/leap/soledad/backends/leap_backend.py @@ -21,10 +21,7 @@ A U1DB backend for encrypting data before sending to server and decrypting after receiving. """ -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json import hashlib import hmac import binascii diff --git a/src/leap/soledad/server.py b/src/leap/soledad/server.py index 5a2bb81f..9c9e0ad7 100644 --- a/src/leap/soledad/server.py +++ b/src/leap/soledad/server.py @@ -25,10 +25,7 @@ This should be run with: import configparser import httplib -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json from hashlib import sha256 diff --git a/src/leap/soledad/shared_db.py b/src/leap/soledad/shared_db.py index c954dbea..33c5c484 100644 --- a/src/leap/soledad/shared_db.py +++ b/src/leap/soledad/shared_db.py @@ -20,10 +20,7 @@ A shared database for storing/retrieving encrypted key material. """ -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json from u1db.remote import http_database diff --git a/src/leap/soledad/tests/test_couch.py b/src/leap/soledad/tests/test_couch.py index d6b9ad83..b3cbc1bc 100644 --- a/src/leap/soledad/tests/test_couch.py +++ b/src/leap/soledad/tests/test_couch.py @@ -31,10 +31,7 @@ from leap.soledad.backends import couch from leap.soledad.tests import u1db_tests as tests from leap.soledad.tests.u1db_tests import test_backends from leap.soledad.tests.u1db_tests import test_sync -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json from leap.soledad.backends.leap_backend import ( LeapDocument, ) diff --git a/src/leap/soledad/tests/test_crypto.py b/src/leap/soledad/tests/test_crypto.py index 72eac6eb..5432856e 100644 --- a/src/leap/soledad/tests/test_crypto.py +++ b/src/leap/soledad/tests/test_crypto.py @@ -23,10 +23,7 @@ Tests for cryptographic related stuff. import os import shutil import tempfile -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json import hashlib diff --git a/src/leap/soledad/tests/test_leap_backend.py b/src/leap/soledad/tests/test_leap_backend.py index 458fc5d5..d04ee412 100644 --- a/src/leap/soledad/tests/test_leap_backend.py +++ b/src/leap/soledad/tests/test_leap_backend.py @@ -23,12 +23,10 @@ Test Leap backend bits. import u1db import os import ssl -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json import cStringIO + from u1db.sync import Synchronizer from u1db.remote import ( http_client, diff --git a/src/leap/soledad/tests/test_server.py b/src/leap/soledad/tests/test_server.py index d574b50e..ec3f636b 100644 --- a/src/leap/soledad/tests/test_server.py +++ b/src/leap/soledad/tests/test_server.py @@ -23,10 +23,7 @@ Tests for server-related functionality. import os import shutil import tempfile -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json import hashlib diff --git a/src/leap/soledad/tests/test_soledad.py b/src/leap/soledad/tests/test_soledad.py index 5eef039f..1c0e6d4a 100644 --- a/src/leap/soledad/tests/test_soledad.py +++ b/src/leap/soledad/tests/test_soledad.py @@ -24,10 +24,7 @@ Tests for general Soledad functionality. import os import re import tempfile -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json from leap.common.testing.basetest import BaseLeapTest diff --git a/src/leap/soledad/tests/test_sqlcipher.py b/src/leap/soledad/tests/test_sqlcipher.py index 5bfb8de6..b0ec97a0 100644 --- a/src/leap/soledad/tests/test_sqlcipher.py +++ b/src/leap/soledad/tests/test_sqlcipher.py @@ -24,11 +24,10 @@ Test sqlcipher backend internals. import os import time import unittest -try: - import simplejson as json -except ImportError: - import json # noqa +import simplejson as json import threading + + from pysqlcipher import dbapi2 from StringIO import StringIO -- cgit v1.2.3