diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-15 09:42:08 +0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-15 09:42:08 +0200 |
commit | 89d26f3cd389f41b83d27ea225944a0ff8bc2e95 (patch) | |
tree | 31275a0e7c350fd2b9acc2d1210d972bb9a0d3c8 /service/pixelated/bitmask_libraries | |
parent | 6d08b8e65d2c1679d4b489ac196116847f91b3a7 (diff) |
Getting rid of singletons and optimizing imports
Diffstat (limited to 'service/pixelated/bitmask_libraries')
-rw-r--r-- | service/pixelated/bitmask_libraries/config.py | 3 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/leap_srp.py | 3 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/provider.py | 1 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/session.py | 7 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/smtp.py | 1 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/soledad.py | 8 |
6 files changed, 11 insertions, 12 deletions
diff --git a/service/pixelated/bitmask_libraries/config.py b/service/pixelated/bitmask_libraries/config.py index c1255060..1cc10523 100644 --- a/service/pixelated/bitmask_libraries/config.py +++ b/service/pixelated/bitmask_libraries/config.py @@ -13,9 +13,10 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. +from distutils.spawn import find_executable + import os from os.path import expanduser -from distutils.spawn import find_executable def discover_gpg_binary(): diff --git a/service/pixelated/bitmask_libraries/leap_srp.py b/service/pixelated/bitmask_libraries/leap_srp.py index 05e27a94..7a627c1d 100644 --- a/service/pixelated/bitmask_libraries/leap_srp.py +++ b/service/pixelated/bitmask_libraries/leap_srp.py @@ -15,13 +15,14 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import binascii import json -import requests +import requests from requests import Session from srp import User, srp, create_salted_verification_key from requests.exceptions import HTTPError, SSLError, Timeout from config import SYSTEM_CA_BUNDLE + REGISTER_USER_LOGIN_KEY = 'user[login]' REGISTER_USER_VERIFIER_KEY = 'user[password_verifier]' REGISTER_USER_SALT_KEY = 'user[password_salt]' diff --git a/service/pixelated/bitmask_libraries/provider.py b/service/pixelated/bitmask_libraries/provider.py index 6848dc6e..4fe5f17d 100644 --- a/service/pixelated/bitmask_libraries/provider.py +++ b/service/pixelated/bitmask_libraries/provider.py @@ -17,7 +17,6 @@ import json from leap.common.certs import get_digest import requests - from .certs import which_bundle diff --git a/service/pixelated/bitmask_libraries/session.py b/service/pixelated/bitmask_libraries/session.py index 7c195391..78219635 100644 --- a/service/pixelated/bitmask_libraries/session.py +++ b/service/pixelated/bitmask_libraries/session.py @@ -13,23 +13,24 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. -import os import errno import traceback +import sys + +import os from leap.mail.imap.fetch import LeapIncomingMail from leap.mail.imap.account import SoledadBackedAccount -import sys from leap.mail.imap.memorystore import MemoryStore from leap.mail.imap.soledadstore import SoledadStore from pixelated.bitmask_libraries.config import LeapConfig from pixelated.bitmask_libraries.provider import LeapProvider from twisted.internet import reactor from .nicknym import NickNym - from .auth import LeapAuthenticator, LeapCredentials from .soledad import SoledadSessionFactory, SoledadSession from .smtp import LeapSmtp + SESSIONS = {} diff --git a/service/pixelated/bitmask_libraries/smtp.py b/service/pixelated/bitmask_libraries/smtp.py index a04fbf74..343cb655 100644 --- a/service/pixelated/bitmask_libraries/smtp.py +++ b/service/pixelated/bitmask_libraries/smtp.py @@ -17,7 +17,6 @@ import os import requests from .certs import which_bundle from leap.mail.smtp import setup_smtp_gateway -import random class LeapSmtp(object): diff --git a/service/pixelated/bitmask_libraries/soledad.py b/service/pixelated/bitmask_libraries/soledad.py index f274dfc1..cf71a727 100644 --- a/service/pixelated/bitmask_libraries/soledad.py +++ b/service/pixelated/bitmask_libraries/soledad.py @@ -13,17 +13,15 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. -import json -import os import errno + +import os from leap.keymanager import KeyManager from leap.soledad.client import Soledad from leap.soledad.common.crypto import WrongMac, UnknownMacMethod, MacMethods -import requests -import sys -import time from .certs import which_bundle + SOLEDAD_TIMEOUT = 120 SOLEDAD_CERT = '/tmp/ca.crt' |