summaryrefslogtreecommitdiff
path: root/src/leap/bitmask
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-04-07 11:09:05 -0400
committerKali Kaneko <kali@leap.se>2016-04-07 11:09:05 -0400
commit42e4458f3f37d50725a37a7e22835ab677cc24aa (patch)
tree3b4b69a948d7ca23f4031abcffea0d08dfc21b49 /src/leap/bitmask
parentdadfb03b90d099d50c7c225da297952cdfb7b9aa (diff)
[style] pep8
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r--src/leap/bitmask/__init__.py3
-rw-r--r--src/leap/bitmask/app.py20
-rw-r--r--src/leap/bitmask/config/leapsettings.py1
-rw-r--r--src/leap/bitmask/util/keyring_helpers.py5
-rw-r--r--src/leap/bitmask/util/pastebin.py4
5 files changed, 18 insertions, 15 deletions
diff --git a/src/leap/bitmask/__init__.py b/src/leap/bitmask/__init__.py
index 6ab55e53..c25ae999 100644
--- a/src/leap/bitmask/__init__.py
+++ b/src/leap/bitmask/__init__.py
@@ -19,6 +19,8 @@ Init file for leap.bitmask
Initializes version and app info.
"""
+from ._version import get_versions
+
# HACK: This is a hack so that py2app copies _scrypt.so to the right
# place, it can't be technically imported, but that doesn't matter
# because the import is never executed
@@ -45,7 +47,6 @@ def _is_release_version(version_str):
return patch.isdigit()
-from ._version import get_versions
__version__ = get_versions()['version']
__version_hash__ = get_versions()['full-revisionid']
IS_RELEASE_VERSION = _is_release_version(__version__)
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py
index 0c4c32e2..0ae60e48 100644
--- a/src/leap/bitmask/app.py
+++ b/src/leap/bitmask/app.py
@@ -46,11 +46,7 @@ import os
import platform
import sys
-if platform.system() == "Darwin":
- # We need to tune maximum number of files, due to zmq usage
- # we hit the limit.
- import resource
- resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 10240))
+import psutil
from leap.bitmask import __version__ as VERSION
from leap.bitmask.backend.backend_proxy import BackendProxy
@@ -70,7 +66,12 @@ from leap.mail import __version__ as MAIL_VERSION
import codecs
codecs.register(lambda name: codecs.lookup('utf-8')
if name == 'cp65001' else None)
-import psutil
+
+if platform.system() == "Darwin":
+ # We need to tune maximum number of files, due to zmq usage
+ # we hit the limit.
+ import resource
+ resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 10240))
def kill_the_children():
@@ -226,9 +227,10 @@ def start_app():
backend_pid = None
if not backend_running:
frontend_pid = os.getpid()
- backend_process = multiprocessing.Process(target=run_backend,
- name='Backend',
- args=(opts.danger, flags_dict, frontend_pid))
+ backend_process = multiprocessing.Process(
+ target=run_backend,
+ name='Backend',
+ args=(opts.danger, flags_dict, frontend_pid))
# we don't set the 'daemon mode' since we need to start child processes
# in the backend
# backend_process.daemon = True
diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py
index d7590c24..01900484 100644
--- a/src/leap/bitmask/config/leapsettings.py
+++ b/src/leap/bitmask/config/leapsettings.py
@@ -361,4 +361,3 @@ class LeapSettings(object):
def set_pixelmail_enabled(self, enabled):
leap_assert_type(enabled, bool)
self._settings.setvalue(self.PIXELMAIL_KEY, enabled)
-
diff --git a/src/leap/bitmask/util/keyring_helpers.py b/src/leap/bitmask/util/keyring_helpers.py
index d81f39b1..c5181348 100644
--- a/src/leap/bitmask/util/keyring_helpers.py
+++ b/src/leap/bitmask/util/keyring_helpers.py
@@ -24,8 +24,9 @@ try:
EncryptedKeyring,
PlaintextKeyring
]
- canuse = lambda kr: (kr is not None
- and kr.__class__ not in OBSOLETE_KEYRINGS)
+ canuse = lambda kr: (
+ kr is not None and
+ kr.__class__ not in OBSOLETE_KEYRINGS)
except Exception:
# Problems when importing keyring! It might be a problem binding to the
diff --git a/src/leap/bitmask/util/pastebin.py b/src/leap/bitmask/util/pastebin.py
index 6d50ac9e..b476ad88 100644
--- a/src/leap/bitmask/util/pastebin.py
+++ b/src/leap/bitmask/util/pastebin.py
@@ -25,13 +25,13 @@
#############################################################################
+import urllib
+
__ALL__ = ['delete_paste', 'user_details', 'trending', 'pastes_by_user',
'generate_user_key', 'paste', 'Pastebin', 'PastebinError',
'PostLimitError']
-import urllib
-
class PastebinError(RuntimeError):
"""Pastebin API error.