From 76ec3cde51d20802c24abfb893a9849e019c6e53 Mon Sep 17 00:00:00 2001 From: "rmlibre@riseup.net" Date: Sat, 1 May 2021 13:53:38 -0400 Subject: [PATCH] v0.7.5: Some small tweaks for efficiency & utility. --- tiny_gnupg/tiny_gnupg.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tiny_gnupg/tiny_gnupg.py b/tiny_gnupg/tiny_gnupg.py index 49cf856..f2978a5 100644 --- a/tiny_gnupg/tiny_gnupg.py +++ b/tiny_gnupg/tiny_gnupg.py @@ -66,7 +66,7 @@ def __init__(self, *, port=80, tor_port=9050): self.tor_port = tor_port def Connector( - self, *, proxy_type=None, host=None, port=None, rdns=True + self, *, proxy_type=None, host=None, port=None, rdns=True, **kw ): """ Autoconstruct an aiohttp_socks.ProxyConnector instance. @@ -76,6 +76,7 @@ def Connector( host=host if host else "localhost", port=port if port else self.tor_port, rdns=rdns, + **kw, ) def Session(self, *, connector=None, **kw): @@ -698,9 +699,9 @@ def _reset_daemon(self): command = [ "gpgconf", "--homedir", self.homedir, "--kill", "gpg-agent" ] - kill_output = self.read_output(command) + kill_output = Terminal.enter(command) command = ["gpg-agent", "--homedir", self.homedir, "--daemon"] - reset_output = self.read_output(command) + reset_output = Terminal.enter(command) return kill_output, reset_output def _add_subkeys(self, uid=""): @@ -772,7 +773,7 @@ def gen_key(self): "", "O", ) - output = self.read_output(command, inputs, stderr=STDOUT) + output = Terminal.enter(command, inputs, stderr=STDOUT) self.fingerprint = output.strip().split("\n")[-1][-40:] self._add_subkeys(self.fingerprint) @@ -1175,7 +1176,7 @@ def text_export(self, uid="", *, secret=False): return self.read_output(command, inputs) elif secret == False: command = self.encode_command("-a", "--export", uid) - return self.read_output(command) + return Terminal.enter(command) else: raise TypeError(f"``secret`` != bool, {type(secret)} given.")