diff options
author | Ben McGinnes <[email protected]> | 2018-06-10 15:03:58 +0000 |
---|---|---|
committer | Ben McGinnes <[email protected]> | 2018-06-10 15:03:58 +0000 |
commit | 92cd060f5e2f4fdbfbe4812ebe8ef57e82e1609f (patch) | |
tree | 5cad85ff2689b9b88f4d68e274e3dfd661b11425 /lang/python/examples/howto/groups.py | |
parent | cpp: Add proper gpgme_op_createkey (diff) | |
download | gpgme-92cd060f5e2f4fdbfbe4812ebe8ef57e82e1609f.tar.gz gpgme-92cd060f5e2f4fdbfbe4812ebe8ef57e82e1609f.zip |
script: groups.py
* Added check for if it is run on a Windows system so that the correct
binary filename is invoked.
Diffstat (limited to 'lang/python/examples/howto/groups.py')
-rw-r--r-- | lang/python/examples/howto/groups.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/examples/howto/groups.py b/lang/python/examples/howto/groups.py index fe31d7f5..b8317b69 100644 --- a/lang/python/examples/howto/groups.py +++ b/lang/python/examples/howto/groups.py @@ -24,6 +24,7 @@ from __future__ import absolute_import, division, unicode_literals # <http://www.gnu.org/licenses/>. import subprocess +import sys """ Intended for use with other scripts. @@ -31,7 +32,12 @@ Intended for use with other scripts. Usage: from groups import group_lists """ -lines = subprocess.getoutput("gpgconf --list-options gpg").splitlines() +if sys.platform == "win32": + gpgconfcmd = "gpgconf.exe --list-options gpg" +else: + gpgconfcmd = "gpgconf --list-options gpg" + +lines = subprocess.getoutput(gpgconfcmd).splitlines() for i in range(len(lines)): if lines[i].startswith("group") is True: |