Skip to content

Commit

Permalink
v0.7.5: Some small tweaks for efficiency & utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmlibre committed May 1, 2021
1 parent 18fadc2 commit 76ec3cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tiny_gnupg/tiny_gnupg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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):
Expand Down Expand Up @@ -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=""):
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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.")

0 comments on commit 76ec3cd

Please sign in to comment.