def test_get(self): self.assertEqual(check_data_writable(), []) # This will generate new key key = get_gpg_sign_key() self.assertIsNotNone(key) # Check cache access self.assertEqual(key, get_gpg_sign_key()) # Check empty cache cache.delete('gpg-key-id') self.assertEqual(key, get_gpg_sign_key())
def page_context(self, context): context.update({ 'title': _('Weblate keys'), 'gpg_key_id': get_gpg_sign_key(), 'gpg_key': get_gpg_public_key(), 'ssh_key': get_key_data(), 'allow_index': True, })
def page_context(self, context): context.update({ "title": _("Weblate keys"), "gpg_key_id": get_gpg_sign_key(), "gpg_key": get_gpg_public_key(), "ssh_key": get_key_data(), "allow_index": True, })
def keys(request): """Show keys information.""" return render( request, 'keys.html', { 'title': _('Weblate keys'), 'gpg_key_id': get_gpg_sign_key(), 'gpg_key': get_gpg_public_key(), 'ssh_key': get_key_data(), 'allow_index': True, })
def about(request): """Show about page with version information.""" return render( request, 'about.html', { 'title': _('About Weblate'), 'versions': get_versions() + get_optional_versions(), 'allow_index': True, 'gpg_key_id': get_gpg_sign_key(), 'gpg_key': get_gpg_public_key(), })
def about(request): """Show about page with version information.""" return render( request, 'about.html', { 'title': _('About Weblate'), 'versions': get_versions() + get_optional_versions(), 'allow_index': True, 'gpg_key_id': get_gpg_sign_key(), 'gpg_key': get_gpg_public_key(), } )
def get_gpg_sign_args(): sign_key = get_gpg_sign_key() if sign_key: return ["--gpg-sign={}".format(sign_key)] return []
def _get_gpg_sign(): sign_key = get_gpg_sign_key() if sign_key: return ['--gpg-sign={}'.format(sign_key)] return []
def get_gpg_sign_args(): sign_key = get_gpg_sign_key() if sign_key: return [f"--gpg-sign={sign_key}"] return []