Skip to content

Commit bb21aac

Browse files
committed
add some pydoc and fix get_users_iter param
1 parent a69ae53 commit bb21aac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dspace_rest_client/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ class PatchOperation:
8484
MOVE = 'move'
8585

8686
def paginated(embed_name, item_constructor, embedding=lambda x: x):
87+
"""
88+
@param embed_name: The key under '_embedded' in the JSON response that contains the resources to be paginated.
89+
(e.g. 'collections', 'objects', 'items', etc.)
90+
@param item_constructor: A callable that takes a resource dictionary and returns an item.
91+
@param embedding: Optional post-fetch processing lambda (default: identity function) for each resource
92+
@return: A decorator that, when applied to a method, follows pagination and yields each resource
93+
"""
8794
def decorator(fun):
8895
@functools.wraps(fun)
8996
def decorated(self, *args, **kwargs):
@@ -1096,6 +1103,7 @@ def get_users_iter(do_paginate, self, sort=None):
10961103
@return: Iterator of User
10971104
"""
10981105
url = f'{self.API_ENDPOINT}/eperson/epersons'
1106+
params = {}
10991107
if sort is not None:
11001108
params['sort'] = sort
11011109

0 commit comments

Comments
 (0)