'Initialize a GPG process wrapper.  Options are:
gpgbinary -- full pathname for GPG binary.
gnupghome -- full pathname to where we can find the public and
private keyrings.  Default is whatever gpg defaults to.
keyring -- name of alternative keyring file to use. If specified,
the default keyring is not used.'

def __init__(self, gpgbinary='gpg', gnupghome=None, verbose=False, use_agent=False, keyring=None):

    self.gpgbinary = gpgbinary
    self.gnupghome = gnupghome
    self.keyring = keyring
    self.verbose = verbose
    self.use_agent = use_agent
    self.encoding = locale.getpreferredencoding()
    if (self.encoding is None):
        self.encoding = sys.stdin.encoding
    if (gnupghome and (not os.path.isdir(self.gnupghome))):
        os.makedirs(self.gnupghome, 448)
    p = self._open_subprocess(['--version'])
    result = self.result_map['verify'](self)
    self._collect_output(p, result, stdin=p.stdin)
    if (p.returncode != 0):
        raise ValueError(('Error    invoking    gpg:    %s:    %s' % (p.returncode, result.stderr)))
