diff options
author | Cyril Jouve <jv.cyril@gmail.com> | 2018-05-22 00:46:17 +0200 |
---|---|---|
committer | Cyril Jouve <jv.cyril@gmail.com> | 2018-05-22 02:39:46 +0200 |
commit | 589a9aad58383b98b5321db106e77afa0a9a761b (patch) | |
tree | b1bc0ff8cacc33905b4e4ffc48ec5612465866bf /gitlab/config.py | |
parent | 97c8619c5b07abc714417d6e5be2f553270b54a6 (diff) | |
download | gitlab-589a9aad58383b98b5321db106e77afa0a9a761b.tar.gz |
add per_page config option
Diffstat (limited to 'gitlab/config.py')
-rw-r--r-- | gitlab/config.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index c3fcf70..9f4c11d 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -140,3 +140,13 @@ class GitlabConfigParser(object): if self.api_version not in ('4',): raise GitlabDataError("Unsupported API version: %s" % self.api_version) + + self.per_page = None + for section in ['global', self.gitlab_id]: + try: + self.per_page = self._config.getint(section, 'per_page') + except Exception: + pass + if self.per_page is not None and not 0 <= self.per_page <= 100: + raise GitlabDataError("Unsupported per_page number: %s" % + self.per_page) |