def key_list(request, secret=True): msg_queue = Queue(queue_name='gpg_msg_queue') while True: msg_data = msg_queue.pull() if not msg_data: break; messages.add_message(request, msg_data.get('tag', messages.INFO), msg_data['message']) if secret: object_list = Key.get_all(gpg, secret=True, exclude=LocalNode().get().public_key) title = _(u'Private key list') else: object_list = Key.get_all(gpg) title = _(u'Public key list') return render_to_response('key_list.html', { 'object_list': object_list, 'title': title, }, context_instance=RequestContext(request))
def __init__(self, *args, **kwargs): super(ResourceForm, self).__init__(*args, **kwargs) self.fields['key'].choices = [(key.fingerprint, key) for key in Key.get_all(gpg, secret=True, exclude=LocalNode().get().public_key)] self.fields['key'].widget.attrs = {'style': 'width: auto;'}
def __init__(self, *args, **kwargs): super(KeySelectionForm, self).__init__(*args, **kwargs) self.fields['key'].choices = [(key.fingerprint, key) for key in Key.get_all(gpg, secret=True)] self.fields['key'].widget.attrs = {'style': 'width: auto;'}