Create a pipeline to process a file after downloading.
        (Optionally decrypt, then decompress)

def get_download_pipeline(in_fd, out_fd, gpg=False, lzop=True):
    """ Create a pipeline to process a file after downloading.
        (Optionally decrypt, then decompress) """
    commands = []
    if gpg:
        commands.append(GPGDecryptionFilter())
    if lzop:
        commands.append(LZODecompressionFilter())
    return Pipeline(commands, in_fd, out_fd)