diff options
| author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-08-21 15:38:39 +0200 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-08-21 15:38:39 +0200 |
| commit | a9e8da98236df39249584bd2700a7bdc70c5a187 (patch) | |
| tree | 5d3517174b608e3c27c94ac68a7d65fe3760d1f3 /gitlab/__init__.py | |
| parent | e93188e2953929d27f2943ae964eab7e3babd6f2 (diff) | |
| download | gitlab-a9e8da98236df39249584bd2700a7bdc70c5a187.tar.gz | |
don't list everything by default
Diffstat (limited to 'gitlab/__init__.py')
| -rw-r--r-- | gitlab/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index f03a356..bc11071 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -343,14 +343,17 @@ class Gitlab(object): # through normal path cls_kwargs['_created'] = True + get_all_results = params.get('all', False) + # Remove parameters from kwargs before passing it to constructor - for key in ['page', 'per_page', 'sudo']: + for key in ['all', 'page', 'per_page', 'sudo']: if key in cls_kwargs: del cls_kwargs[key] results = [cls(self, item, **cls_kwargs) for item in r.json() if item is not None] - if 'next' in r.links and 'url' in r.links['next']: + if ('next' in r.links and 'url' in r.links['next'] + and get_all_results is True): args = kwargs.copy() args['next_url'] = r.links['next']['url'] results.extend(self.list(obj_class, **args)) |
