Verified Commit 95f8a39c by NavaL Committed by meskio

[feat] supplying gpgbinary when building gpg key from dict

parent 0454dc35
......@@ -49,7 +49,7 @@ def is_address(address):
return bool(re.match('[\w.-]+@[\w.-]+', address))
def build_key_from_dict(key, active=None):
def build_key_from_dict(key, active=None, gpgbinary=None):
"""
Build an OpenPGPKey key based on info in C{kdict}.
......@@ -57,6 +57,9 @@ def build_key_from_dict(key, active=None):
:type key: dict
:param active: Dictionary with active data.
:type active: dict
:param gpgbinary: Name for GnuPG binary executable.
:type gpgbinary: C{str}
:return: An instance of the key.
:rtype: C{kClass}
"""
......@@ -94,6 +97,7 @@ def build_key_from_dict(key, active=None):
validation=validation,
encr_used=encr_used,
sign_used=sign_used,
gpgbinary=gpgbinary,
)
......
......@@ -332,10 +332,13 @@ class OpenPGPScheme(object):
else:
key = yield self._repair_key_docs(fp_keys)
key.content[HAS_ACTIVE] = True
keys.append(build_key_from_dict(key.content, active.content))
keys.append(build_key_from_dict(key.content, active.content,
gpgbinary=self._gpgbinary))
unactive_keys = filter(lambda k: HAS_ACTIVE not in k.content, key_docs)
keys += map(lambda k: build_key_from_dict(k.content), unactive_keys)
keys += map(lambda k: build_key_from_dict(k.content,
gpgbinary=self._gpgbinary),
unactive_keys)
defer.returnValue(keys)
def parse_key(self, key_data, address=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment