diff options
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/__init__.py | 1 | ||||
-rw-r--r-- | gitlab/const.py | 26 | ||||
-rw-r--r-- | gitlab/objects.py | 22 |
3 files changed, 38 insertions, 11 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index c672c23..0109935 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -28,6 +28,7 @@ import requests import six import gitlab.config +from gitlab.const import * # noqa from gitlab.exceptions import * # noqa from gitlab.objects import * # noqa diff --git a/gitlab/const.py b/gitlab/const.py new file mode 100644 index 0000000..7930c0b --- /dev/null +++ b/gitlab/const.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2016 Gauvain Pocentek <gauvain@pocentek.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +GUEST_ACCESS = 10 +REPORTER_ACCESS = 20 +DEVELOPER_ACCESS = 30 +MASTER_ACCESS = 40 +OWNER_ACCESS = 50 + +VISIBILITY_PRIVATE = 0 +VISIBILITY_INTERNAL = 10 +VISIBILITY_PUBLIC = 20 diff --git a/gitlab/objects.py b/gitlab/objects.py index d537d6a..715c58e 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -795,15 +795,15 @@ class Group(GitlabObject): ('projects', GroupProjectManager, [('group_id', 'id')]), ('issues', GroupIssueManager, [('group_id', 'id')])] - GUEST_ACCESS = 10 - REPORTER_ACCESS = 20 - DEVELOPER_ACCESS = 30 - MASTER_ACCESS = 40 - OWNER_ACCESS = 50 + GUEST_ACCESS = gitlab.GUEST_ACCESS + REPORTER_ACCESS = gitlab.REPORTER_ACCESS + DEVELOPER_ACCESS = gitlab.DEVELOPER_ACCESS + MASTER_ACCESS = gitlab.MASTER_ACCESS + OWNER_ACCESS = gitlab.OWNER_ACCESS - VISIBILITY_PRIVATE = 0 - VISIBILITY_INTERNAL = 10 - VISIBILITY_PUBLIC = 20 + VISIBILITY_PRIVATE = gitlab.VISIBILITY_PRIVATE + VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL + VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC def Member(self, id=None, **kwargs): warnings.warn("`Member` is deprecated, use `members` instead", @@ -1787,9 +1787,9 @@ class Project(GitlabObject): ('variables', ProjectVariableManager, [('project_id', 'id')]), ] - VISIBILITY_PRIVATE = 0 - VISIBILITY_INTERNAL = 10 - VISIBILITY_PUBLIC = 20 + VISIBILITY_PRIVATE = gitlab.VISIBILITY_PRIVATE + VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL + VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC def Branch(self, id=None, **kwargs): warnings.warn("`Branch` is deprecated, use `branches` instead", |