summaryrefslogtreecommitdiff
path: root/keymanager
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2015-07-24 16:24:13 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-08-03 17:16:57 -0300
commitc05c63f17ebdf40cc47ba6259f14dd1eafb7c59e (patch)
tree4df7897664299ad1224a1369f950c2ad6d9d966b /keymanager
parent72af2c1fa3cfd14a9e9c441305a98119a06225c4 (diff)
[style] Fixed pep8 warnings
Fixed pep8 warnings to prepare the keymanager for CI
Diffstat (limited to 'keymanager')
-rw-r--r--keymanager/src/leap/keymanager/__init__.py1
-rw-r--r--keymanager/src/leap/keymanager/_version.py19
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py7
-rw-r--r--keymanager/src/leap/keymanager/tests/test_validation.py1
4 files changed, 15 insertions, 13 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py
index 282ff48..999b53c 100644
--- a/keymanager/src/leap/keymanager/__init__.py
+++ b/keymanager/src/leap/keymanager/__init__.py
@@ -19,6 +19,7 @@ Key Manager is a Nicknym agent for LEAP client.
"""
# let's do a little sanity check to see if we're using the wrong gnupg
import sys
+from ._version import get_versions
try:
from gnupg.gnupg import GPGUtilities
diff --git a/keymanager/src/leap/keymanager/_version.py b/keymanager/src/leap/keymanager/_version.py
index 28fca96..5153a9b 100644
--- a/keymanager/src/leap/keymanager/_version.py
+++ b/keymanager/src/leap/keymanager/_version.py
@@ -1,5 +1,3 @@
-
-IN_LONG_VERSION_PY = True
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (build by setup.py sdist) and build
@@ -10,12 +8,15 @@ IN_LONG_VERSION_PY = True
# versioneer-0.7+ (https://github.com/warner/python-versioneer)
# these strings will be replaced by git during git-archive
-git_refnames = "$Format:%d$"
-git_full = "$Format:%H$"
-
-
import subprocess
import sys
+import re
+import os.path
+
+IN_LONG_VERSION_PY = True
+
+git_refnames = "$Format:%d$"
+git_full = "$Format:%H$"
def run_command(args, cwd=None, verbose=False):
@@ -38,10 +39,6 @@ def run_command(args, cwd=None, verbose=False):
return stdout
-import re
-import os.path
-
-
def get_expanded_variables(versionfile_source):
# the code embedded in _version.py can just fetch the value of these
# variables. When used from setup.py, we don't want to import
@@ -86,7 +83,7 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
# "stabilization", as well as "HEAD" and "master".
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
- print("discarding '%s', no digits" % ",".join(refs-tags))
+ print("discarding '%s', no digits" % ",".join(refs - tags))
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 794a0ec..5d91dc9 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -114,8 +114,11 @@ class TempGPGWrapper(object):
publkeys = filter(
lambda pubkey: pubkey.key_id not in privids, publkeys)
- listkeys = lambda: self._gpg.list_keys()
- listsecretkeys = lambda: self._gpg.list_keys(secret=True)
+ def listkeys():
+ return self._gpg.list_keys()
+
+ def listsecretkeys():
+ return self._gpg.list_keys(secret=True)
self._gpg = GPG(binary=self._gpgbinary,
homedir=tempfile.mkdtemp())
diff --git a/keymanager/src/leap/keymanager/tests/test_validation.py b/keymanager/src/leap/keymanager/tests/test_validation.py
index 561ca50..ddf1170 100644
--- a/keymanager/src/leap/keymanager/tests/test_validation.py
+++ b/keymanager/src/leap/keymanager/tests/test_validation.py
@@ -18,6 +18,7 @@
Tests for the Validation Levels
"""
+import unittest
from datetime import datetime
from twisted.internet.defer import inlineCallbacks