def get_sign_command(self, filename, signer, sign_password,<EOL>keystore=None):
cmd = [self.gpg, '<STR_LIT>', '<STR_LIT:2>', '<STR_LIT>']<EOL>if keystore is None:<EOL><INDENT>keystore = self.gpg_home<EOL><DEDENT>if keystore:<EOL><INDENT>cmd.extend(['<STR_LIT>', keystore])<EOL><DEDENT>if sign_password is not None:<EOL><INDENT>cmd.extend(['<STR_LIT>', '<STR_LIT>', '<STR_LIT:0>'])<EOL><DEDENT>td = tempfile.mkdtemp()<EOL>sf = os.path.join(td, os.path.basename(filename) + '<STR_LIT>')<EOL>cmd.extend(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>signer, '<STR_LIT>', sf, filename])<EOL>logger.debug('<STR_LIT>', '<STR_LIT:U+0020>'.join(cmd))<EOL>return cmd, sf<EOL>
Return a suitable command for signing a file.

:param filename: The pathname to the file to be signed.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
                      private key used for signing.
:param keystore: The path to a directory which contains the keys
                 used in verification. If not specified, the
                 instance's ``gpg_home`` attribute is used instead.
:return: The signing command as a list suitable to be
         passed to :class:`subprocess.Popen`.