From 92cd060f5e2f4fdbfbe4812ebe8ef57e82e1609f Mon Sep 17 00:00:00 2001 From: Ben McGinnes Date: Mon, 11 Jun 2018 01:03:58 +1000 Subject: script: groups.py * Added check for if it is run on a Windows system so that the correct binary filename is invoked. --- lang/python/examples/howto/groups.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lang/python/examples/howto/groups.py') 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 # . 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: -- cgit v1.2.3