[openpgp] Fix some errors

This commit is contained in:
Philipp Hörist
2018-11-02 20:51:01 +01:00
parent eb80f10c21
commit af4664dec0
3 changed files with 5 additions and 5 deletions

View File

@@ -109,9 +109,9 @@ class ContactData:
@property
def userid(self):
if self._jid is None:
if self.jid is None:
raise ValueError('JID not set')
return 'xmpp:%s' % self._jid
return 'xmpp:%s' % self.jid
@property
def default_trust(self):
@@ -185,7 +185,7 @@ class ContactData:
try:
keydata = self._key_store[fingerprint]
except KeyError:
log.warning('Set public key on unknown fingerprint',
log.warning('Set public key on unknown fingerprint: %s %s',
self.jid, fingerprint)
else:
keydata.has_pubkey = True

View File

@@ -95,7 +95,7 @@ class PGPKeylist(AbstractPEPModule):
else:
timestamp = parse_datetime(date, epoch=True)
if timestamp is None:
raise StanzaMalformed('Invalid date timestamp: %s', date)
raise StanzaMalformed('Invalid date timestamp: %s' % date)
keylist.append(Key(attrs['v4-fingerprint'], int(timestamp)))

View File

@@ -207,7 +207,7 @@ def get_info_message():
return '[This message is *encrypted* with OpenPGP (See :XEP:`0373`]'
def add_additional_data(data, fingerprint, trust):
def add_additional_data(data, fingerprint):
data['encrypted'] = {'name': ENCRYPTION_NAME,
'fingerprint': fingerprint}