Skip to content

Commit

Permalink
Make minor updates to documentation and docstrings to improve tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsajip committed Jul 24, 2023
1 parent 77941ef commit 7f7b32d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ accepts to identify a key - for example, the keyid or the fingerprint could be u
If you want to pass a single keyid, then you can just pass in a string which
identifies the key.

The ``export_keys`` method has some additional keyword arguments:
The :meth:`~gnupg.GPG.export_keys` method has some additional keyword arguments:

* ``armor`` (defaulting to ``True``) - when ``True``, passes ``--armor`` to ``gpg``.
* ``minimal`` (defaulting to ``False``) - when ``True``, passes
Expand Down Expand Up @@ -1344,7 +1344,7 @@ In addition, an ``extra_args`` keyword parameter can be specified. If provided,
is treated as a list of additional arguments to pass to the ``gpg`` executable.

.. versionadded:: 0.3.6
The ``verify_data`` method was added.
The :meth:`~gnupg.GPG.verify_data` method was added.

.. versionadded:: 0.4.1
The ``extra_args`` keyword argument was added.
Expand All @@ -1353,10 +1353,10 @@ Accessing gpg's Return Code
===========================

Starting with version 0.4.8, return values to all calls which implement ``gpg``
operations, other than ``export_keys()``, will have a ``returncode`` attribute which
is the return code returned by the ``gpg`` invocation made to perform the operation
(the result of ``export_keys()`` is the set of exported keys and doesn't have this
attribute).
operations, other than :meth:`~gnupg.GPG.export_keys`, will have a ``returncode``
attribute which is the return code returned by the ``gpg`` invocation made to perform the
operation (the result of :meth:`~gnupg.GPG.export_keys` is the set of exported keys and
doesn't have this attribute).

.. versionadded:: 0.4.8
The ``returncode`` attribute was added to result instances.
Expand Down
16 changes: 8 additions & 8 deletions gnupg.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _make_binary_stream(s, encoding):

class StatusHandler(object):
"""
The base class for handling status messages from gpg.
The base class for handling status messages from `gpg`.
"""

def __init__(self, gpg):
Expand Down Expand Up @@ -1043,7 +1043,7 @@ def __init__(self,
gpgbinary (str): A pathname for the GPG binary to use.
gnupghome (str): A pathname to where we can find the public and private keyrings. The default is
whatever gpg defaults to.
whatever `gpg` defaults to.
keyring (str|list): The name of alternative keyring file to use, or a list of such keyring files. If
specified, the default keyring is not used.
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def make_args(self, args, passphrase):
"""
Make a list of command line elements for GPG. The value of ``args``
will be appended. The ``passphrase`` argument needs to be True if
a passphrase will be sent to GPG, else False.
a passphrase will be sent to `gpg`, else False.
Args:
args (list[str]): A list of arguments.
Expand Down Expand Up @@ -1337,7 +1337,7 @@ def set_output_without_confirmation(self, args, output):

def is_valid_passphrase(self, passphrase):
"""
Confirm that the passphrase doesn't contain newline-type characters - it is passed in a pipe to gpg, and so not
Confirm that the passphrase doesn't contain newline-type characters - it is passed in a pipe to `gpg`, and so not
checking could lead to spoofing attacks by passing arbitrary text after passphrase and newline.
Args:
Expand Down Expand Up @@ -1606,7 +1606,7 @@ def delete_keys(self, fingerprints, secret=False, passphrase=None, expect_passph
.. note:: Passphrases
Since GnuPG 2.1, you can't delete secret keys without providing a passphrase. However, if you're expecting
the passphrase to go to gpg via pinentry, you should specify expect_passphrase=False. (It's only checked
the passphrase to go to `gpg` via pinentry, you should specify expect_passphrase=False. (It's only checked
for GnuPG >= 2.1).
"""
if passphrase and not self.is_valid_passphrase(passphrase): # pragma: no cover
Expand Down Expand Up @@ -1651,7 +1651,7 @@ def export_keys(self,
expect_passphrase=True,
output=None):
"""
Export the indicated keys. A 'keyid' is anything gpg accepts.
Export the indicated keys. A 'keyid' is anything `gpg` accepts.
Args:
keyids (str|list[str]): A single keyid or a list of them.
Expand All @@ -1671,7 +1671,7 @@ def export_keys(self,
.. note:: Passphrases
Since GnuPG 2.1, you can't export secret keys without providing a passphrase. However, if you're expecting
the passphrase to go to gpg via pinentry, you should specify expect_passphrase=False. (It's only checked
the passphrase to go to `gpg` via pinentry, you should specify expect_passphrase=False. (It's only checked
for GnuPG >= 2.1).
"""
if passphrase and not self.is_valid_passphrase(passphrase): # pragma: no cover
Expand Down Expand Up @@ -1880,7 +1880,7 @@ def gen_key(self, input):

def gen_key_input(self, **kwargs):
"""
Generate `--gen-key` input (see gpg documentation in DETAILS).
Generate `--gen-key` input (see `gpg` documentation in DETAILS).
Args:
kwargs (dict): A list of keyword arguments.
Expand Down

0 comments on commit 7f7b32d

Please sign in to comment.