From 21cbe0bd07ff61eab821081278b32d09654fad90 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 1 Aug 2016 20:48:00 -0400 Subject: [PATCH] v2: mv _paginate paginate --- endpoints/v2/__init__.py | 4 ++-- endpoints/v2/catalog.py | 4 ++-- endpoints/v2/tag.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/endpoints/v2/__init__.py b/endpoints/v2/__init__.py index 42ac4afa4..6ac99ecdf 100644 --- a/endpoints/v2/__init__.py +++ b/endpoints/v2/__init__.py @@ -31,8 +31,8 @@ time_blueprint(v2_bp, metric_queue) _MAX_RESULTS_PER_PAGE = 50 -def _paginate(limit_kwarg_name='limit', offset_kwarg_name='offset', - callback_kwarg_name='pagination_callback'): +def paginate(limit_kwarg_name='limit', offset_kwarg_name='offset', + callback_kwarg_name='pagination_callback'): def wrapper(func): @wraps(func) def wrapped(*args, **kwargs): diff --git a/endpoints/v2/catalog.py b/endpoints/v2/catalog.py index 635378653..34b195dbc 100644 --- a/endpoints/v2/catalog.py +++ b/endpoints/v2/catalog.py @@ -2,12 +2,12 @@ from flask import jsonify from auth.registry_jwt_auth import process_registry_jwt_auth, get_granted_entity from endpoints.decorators import anon_protect -from endpoints.v2 import v2_bp, _paginate +from endpoints.v2 import v2_bp, paginate @v2_bp.route('/_catalog', methods=['GET']) @process_registry_jwt_auth() @anon_protect -@_paginate() +@paginate() def catalog_search(limit, offset, pagination_callback): username = None entity = get_granted_entity() diff --git a/endpoints/v2/tag.py b/endpoints/v2/tag.py index 66a4e20ea..11253aee0 100644 --- a/endpoints/v2/tag.py +++ b/endpoints/v2/tag.py @@ -2,7 +2,7 @@ from flask import jsonify from auth.registry_jwt_auth import process_registry_jwt_auth from endpoints.common import parse_repository_name -from endpoints.v2 import v2_bp, require_repo_read, _paginate +from endpoints.v2 import v2_bp, require_repo_read, paginate from endpoints.v2.errors import NameUnknown from endpoints.decorators import anon_protect @@ -11,7 +11,7 @@ from endpoints.decorators import anon_protect @process_registry_jwt_auth(scopes=['pull']) @require_repo_read @anon_protect -@_paginate() +@paginate() def list_all_tags(namespace_name, repo_name, limit, offset, pagination_callback): repo = v2.get_repository(namespace_name, repo_name) if repo is None: