(self, args, passphrase=False)
return cmd
Make a list of command line elements for GPG.

        The value of ``args`` will be appended only if it passes the checks in
        :func:`gnupg._parsers._sanitise`. The ``passphrase`` argument needs to
        be True if a passphrase will be sent to GnuPG, else False.

        :param list args: A list of strings of options and flags to pass to
                          ``GPG.binary``. This is input safe, meaning that
                          these values go through strict checks (see
                          ``parsers._sanitise_list``) before being passed to to
                          the input file descriptor for the GnuPG process.
                          Each string should be given exactly as it would be on
                          the commandline interface to GnuPG,
                          e.g. ["--cipher-algo AES256", "--default-key
                          A3ADB67A2CDB8B35"].

        :param bool passphrase: If True, the passphrase will be sent to the
                                stdin file descriptor for the attached GnuPG
                                process.
Make a list of command line elements for GPG.
Make a list of command line elements for GPG .
def _make_args(self, args, passphrase=False):
        """Make a list of command line elements for GPG.

        The value of ``args`` will be appended only if it passes the checks in
        :func:`gnupg._parsers._sanitise`. The ``passphrase`` argument needs to
        be True if a passphrase will be sent to GnuPG, else False.

        :param list args: A list of strings of options and flags to pass to
                          ``GPG.binary``. This is input safe, meaning that
                          these values go through strict checks (see
                          ``parsers._sanitise_list``) before being passed to to
                          the input file descriptor for the GnuPG process.
                          Each string should be given exactly as it would be on
                          the commandline interface to GnuPG,
                          e.g. ["--cipher-algo AES256", "--default-key
                          A3ADB67A2CDB8B35"].

        :param bool passphrase: If True, the passphrase will be sent to the
                                stdin file descriptor for the attached GnuPG
                                process.
        """
        ## see TODO file, tag :io:makeargs:
        cmd = [self.binary,
               '--no-options --no-emit-version --no-tty --status-fd 2']

        if self.homedir: cmd.append('--homedir "%s"' % self.homedir)

        if self.keyring:
            cmd.append('--no-default-keyring --keyring %s' % self.keyring)
        if self.secring:
            cmd.append('--secret-keyring %s' % self.secring)

        if passphrase: cmd.append('--batch --passphrase-fd 0')

        if self.use_agent is True: cmd.append('--use-agent')
        elif self.use_agent is False: cmd.append('--no-use-agent')

        # The arguments for debugging and verbosity should be placed into the
        # cmd list before the options/args in order to resolve Issue #76:
        # https://github.com/isislovecruft/python-gnupg/issues/76
        if self.verbose:
            cmd.append('--debug-all')

            if (isinstance(self.verbose, str) or
                (isinstance(self.verbose, int) and (self.verbose >= 1))):
                # GnuPG<=1.4.18 parses the `--debug-level` command in a way
                # that is incompatible with all other GnuPG versions. :'(
                if self.binary_version and (self.binary_version <= '1.4.18'):
                    cmd.append('--debug-level=%s' % self.verbose)
                else:
                    cmd.append('--debug-level %s' % self.verbose)

        if self.options:
            [cmd.append(opt) for opt in iter(_sanitise_list(self.options))]
        if args:
            [cmd.append(arg) for arg in iter(_sanitise_list(args))]

        return cmd
def _make_args ( self , args , passphrase = False ) : ## see TODO file, tag :io:makeargs: cmd = [ self . binary , '--no-options --no-emit-version --no-tty --status-fd 2' ] if self . homedir : cmd . append ( '--homedir "%s"' % self . homedir ) if self . keyring : cmd . append ( '--no-default-keyring --keyring %s' % self . keyring ) if self . secring : cmd . append ( '--secret-keyring %s' % self . secring ) if passphrase : cmd . append ( '--batch --passphrase-fd 0' ) if self . use_agent is True : cmd . append ( '--use-agent' ) elif self . use_agent is False : cmd . append ( '--no-use-agent' ) # The arguments for debugging and verbosity should be placed into the # cmd list before the options/args in order to resolve Issue #76: # https://github.com/isislovecruft/python-gnupg/issues/76 if self . verbose : cmd . append ( '--debug-all' ) if ( isinstance ( self . verbose , str ) or ( isinstance ( self . verbose , int ) and ( self . verbose >= 1 ) ) ) : # GnuPG<=1.4.18 parses the `--debug-level` command in a way # that is incompatible with all other GnuPG versions. :'( if self . binary_version and ( self . binary_version <= '1.4.18' ) : cmd . append ( '--debug-level=%s' % self . verbose ) else : cmd . append ( '--debug-level %s' % self . verbose ) if self . options : [ cmd . append ( opt ) for opt in iter ( _sanitise_list ( self . options ) ) ] if args : [ cmd . append ( arg ) for arg in iter ( _sanitise_list ( args ) ) ] return cmd