def str_presenter(dumper, data):
    """Patch YAML so that it folds the long query strings."""
    if len(data.splitlines()) > 1:
        return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|'
            )
    return dumper.represent_scalar('tag:yaml.org,2002:str', data)
