PEP8 and general cleanups
This commit is contained in:
@@ -178,7 +178,7 @@ class GPG(object):
|
||||
self.keyservers = keyservers
|
||||
|
||||
self.gpg = gnupg.GPG(**kwargs)
|
||||
|
||||
|
||||
def verify_file(self, file_input, detached_signature=None, fetch_key=False):
|
||||
"""
|
||||
Verify the signature of a file.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
|
||||
|
||||
class KeySearchForm(forms.Form):
|
||||
|
||||
@@ -8,6 +8,6 @@ from .conf.settings import KEYSERVERS, GPG_HOME
|
||||
try:
|
||||
gpg = GPG(home=GPG_HOME, keyservers=KEYSERVERS)
|
||||
except Exception, e:
|
||||
gpg = GPG(keyservers=KEYSERVERS)
|
||||
gpg = GPG(keyservers=KEYSERVERS)
|
||||
sys.stderr.write(u'ERROR: GPG initialization error: %s\n' % e)
|
||||
sys.stderr.write(u'INFO: Initializating GPG with system default home\n')
|
||||
|
||||
@@ -9,12 +9,11 @@ from django.template import RequestContext
|
||||
from django.contrib import messages
|
||||
|
||||
from permissions.models import Permission
|
||||
from common.utils import (urlquote, encapsulate)
|
||||
from common.utils import encapsulate
|
||||
|
||||
from .api import Key, SIGNATURE_STATES
|
||||
from .api import Key
|
||||
from .runtime import gpg
|
||||
from .exceptions import (GPGVerificationError, KeyFetchingError,
|
||||
KeyImportError)
|
||||
from .exceptions import KeyFetchingError, KeyImportError
|
||||
from .forms import KeySearchForm
|
||||
from .permissions import (PERMISSION_KEY_VIEW, PERMISSION_KEY_DELETE,
|
||||
PERMISSION_KEYSERVER_QUERY, PERMISSION_KEY_RECEIVE)
|
||||
@@ -40,7 +39,7 @@ def key_receive(request, key_id):
|
||||
except (KeyImportError, KeyError, TypeError), e:
|
||||
messages.error(
|
||||
request,
|
||||
_(u'Unable to import key id: %(key_id)s; %(error)s') %
|
||||
_(u'Unable to import key id: %(key_id)s; %(error)s') %
|
||||
{
|
||||
'key_id': key_id,
|
||||
'error': e,
|
||||
|
||||
Reference in New Issue
Block a user