Misc cleanups, PEP8, conding conventions, spaces, unused imports, False/True comparisons

This commit is contained in:
Roberto Rosario
2014-05-23 03:06:26 -04:00
parent cdb93e46ae
commit 935845719f
44 changed files with 188 additions and 223 deletions

View File

@@ -1,19 +1,19 @@
from __future__ import absolute_import
import logging
import tempfile
import os
import tempfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.utils.translation import ugettext_lazy as _
from hkp import KeyServer
import gnupg
from django.utils.translation import ugettext_lazy as _
from .exceptions import (GPGVerificationError, GPGSigningError,
GPGDecryptionError, KeyDeleteError, KeyGenerationError,
KeyFetchingError, KeyDoesNotExist, KeyImportError)
@@ -110,7 +110,7 @@ class Key(object):
keys = gpg.gpg.list_keys(secret=secret)
key = next((key for key in keys if key['keyid'] == key_id), None)
if not key:
if search_keyservers and secret == False:
if search_keyservers and secret is False:
try:
gpg.receive_key(key_id)
return Key(gpg, key_id)