| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 23b2a30 commit 2ced9d0
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,15 +45,15 @@ | |||
| 45 | 45 | ||
| 46 | 46 | # member create | |
| 47 | 47 | member = gl.group_members.create({'user_id': user_id, | |
| 48 | - 'access_level': Group.GUEST_ACCESS}, | ||
| 48 | + 'access_level': gitlab.GUEST_ACCESS}, | ||
| 49 | 49 | group_id=1) | |
| 50 | 50 | # or | |
| 51 | 51 | member = group.members.create({'user_id': user_id, | |
| 52 | - 'access_level': Group.GUEST_ACCESS}) | ||
| 52 | + 'access_level': gitlab.GUEST_ACCESS}) | ||
| 53 | 53 | # end member create | |
| 54 | 54 | ||
| 55 | 55 | # member update | |
| 56 | - member.access_level = Group.DEVELOPER_ACCESS | ||
| 56 | + member.access_level = gitlab.DEVELOPER_ACCESS | ||
| 57 | 57 | member.save() | |
| 58 | 58 | # end member update | |
| 59 | 59 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,15 +94,15 @@ | |||
| 94 | 94 | ||
| 95 | 95 | # members add | |
| 96 | 96 | member = gl.project_members.create({'user_id': user.id, 'access_level': | |
| 97 | - gitlab.Group.DEVELOPER_ACCESS}, | ||
| 97 | + gitlab.DEVELOPER_ACCESS}, | ||
| 98 | 98 | project_id=1) | |
| 99 | 99 | # or | |
| 100 | 100 | member = project.members.create({'user_id': user.id, 'access_level': | |
| 101 | - gitlab.Group.DEVELOPER_ACCESS}) | ||
| 101 | + gitlab.DEVELOPER_ACCESS}) | ||
| 102 | 102 | # end members add | |
| 103 | 103 | ||
| 104 | 104 | # members update | |
| 105 | - member.access_level = gitlab.Group.MASTER_ACCESS | ||
| 105 | + member.access_level = gitlab.MASTER_ACCESS | ||
| 106 | 106 | member.save() | |
| 107 | 107 | # end members update | |
| 108 | 108 | ||
@@ -115,7 +115,7 @@ | |||
| 115 | 115 | # end members delete | |
| 116 | 116 | ||
| 117 | 117 | # share | |
| 118 | - project.share(group.id, group.DEVELOPER_ACCESS) | ||
| 118 | + project.share(group.id, gitlab.DEVELOPER_ACCESS) | ||
| 119 | 119 | # end share | |
| 120 | 120 | ||
| 121 | 121 | # hook list | |
@@ -291,14 +291,14 @@ | |||
| 291 | 291 | 'file_name': 'foo.py', | |
| 292 | 292 | 'code': 'import gitlab', | |
| 293 | 293 | 'visibility_level': | |
| 294 | - Project.VISIBILITY_PRIVATE}, | ||
| 294 | + gitlab.VISIBILITY_PRIVATE}, | ||
| 295 | 295 | project_id=1) | |
| 296 | 296 | # or | |
| 297 | 297 | snippet = project.snippets.create({'title': 'sample 1', | |
| 298 | 298 | 'file_name': 'foo.py', | |
| 299 | 299 | 'code': 'import gitlab', | |
| 300 | 300 | 'visibility_level': | |
| 301 | - Project.VISIBILITY_PRIVATE}) | ||
| 301 | + gitlab.VISIBILITY_PRIVATE}) | ||
| 302 | 302 | # end snippets create | |
| 303 | 303 | ||
| 304 | 304 | # snippets content | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ | |||
| 28 | 28 | import six | |
| 29 | 29 | ||
| 30 | 30 | import gitlab.config | |
| 31 | + from gitlab.const import * # noqa | ||
| 31 | 32 | from gitlab.exceptions import * # noqa | |
| 32 | 33 | from gitlab.objects import * # noqa | |
| 33 | 34 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + # -*- coding: utf-8 -*- | ||
| 2 | + # | ||
| 3 | + # Copyright (C) 2016 Gauvain Pocentek <gauvain@pocentek.net> | ||
| 4 | + # | ||
| 5 | + # This program is free software: you can redistribute it and/or modify | ||
| 6 | + # it under the terms of the GNU Lesser General Public License as published by | ||
| 7 | + # the Free Software Foundation, either version 3 of the License, or | ||
| 8 | + # (at your option) any later version. | ||
| 9 | + # | ||
| 10 | + # This program is distributed in the hope that it will be useful, | ||
| 11 | + # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | + # GNU Lesser General Public License for more details. | ||
| 14 | + # | ||
| 15 | + # You should have received a copy of the GNU Lesser General Public License | ||
| 16 | + # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | + | ||
| 18 | + GUEST_ACCESS = 10 | ||
| 19 | + REPORTER_ACCESS = 20 | ||
| 20 | + DEVELOPER_ACCESS = 30 | ||
| 21 | + MASTER_ACCESS = 40 | ||
| 22 | + OWNER_ACCESS = 50 | ||
| 23 | + | ||
| 24 | + VISIBILITY_PRIVATE = 0 | ||
| 25 | + VISIBILITY_INTERNAL = 10 | ||
| 26 | + VISIBILITY_PUBLIC = 20 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -795,15 +795,15 @@ class Group(GitlabObject): | |||
| 795 | 795 | ('projects', GroupProjectManager, [('group_id', 'id')]), | |
| 796 | 796 | ('issues', GroupIssueManager, [('group_id', 'id')])] | |
| 797 | 797 | ||
| 798 | - GUEST_ACCESS = 10 | ||
| 799 | - REPORTER_ACCESS = 20 | ||
| 800 | - DEVELOPER_ACCESS = 30 | ||
| 801 | - MASTER_ACCESS = 40 | ||
| 802 | - OWNER_ACCESS = 50 | ||
| 798 | + GUEST_ACCESS = gitlab.GUEST_ACCESS | ||
| 799 | + REPORTER_ACCESS = gitlab.REPORTER_ACCESS | ||
| 800 | + DEVELOPER_ACCESS = gitlab.DEVELOPER_ACCESS | ||
| 801 | + MASTER_ACCESS = gitlab.MASTER_ACCESS | ||
| 802 | + OWNER_ACCESS = gitlab.OWNER_ACCESS | ||
| 803 | 803 | ||
| 804 | - VISIBILITY_PRIVATE = 0 | ||
| 805 | - VISIBILITY_INTERNAL = 10 | ||
| 806 | - VISIBILITY_PUBLIC = 20 | ||
| 804 | + VISIBILITY_PRIVATE = gitlab.VISIBILITY_PRIVATE | ||
| 805 | + VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL | ||
| 806 | + VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC | ||
| 807 | 807 | ||
| 808 | 808 | def Member(self, id=None, **kwargs): | |
| 809 | 809 | warnings.warn("`Member` is deprecated, use `members` instead", | |
@@ -1787,9 +1787,9 @@ class Project(GitlabObject): | |||
| 1787 | 1787 | ('variables', ProjectVariableManager, [('project_id', 'id')]), | |
| 1788 | 1788 | ] | |
| 1789 | 1789 | ||
| 1790 | - VISIBILITY_PRIVATE = 0 | ||
| 1791 | - VISIBILITY_INTERNAL = 10 | ||
| 1792 | - VISIBILITY_PUBLIC = 20 | ||
| 1790 | + VISIBILITY_PRIVATE = gitlab.VISIBILITY_PRIVATE | ||
| 1791 | + VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL | ||
| 1792 | + VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC | ||
| 1793 | 1793 | ||
| 1794 | 1794 | def Branch(self, id=None, **kwargs): | |
| 1795 | 1795 | warnings.warn("`Branch` is deprecated, use `branches` instead", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments