| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 31882b8 commit 4540614
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ API objects manipulation | |||
| 13 | 13 | gl_objects/groups | |
| 14 | 14 | gl_objects/issues | |
| 15 | 15 | gl_objects/labels | |
| 16 | + gl_objects/licenses | ||
| 16 | 17 | gl_objects/namespaces | |
| 17 | 18 | gl_objects/projects | |
| 18 | 19 | gl_objects/runners | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + # list | ||
| 2 | + licenses = gl.licenses.list() | ||
| 3 | + # end list | ||
| 4 | + | ||
| 5 | + # get | ||
| 6 | + license = gl.licenses.get('apache-2.0', project='foobar', fullname='John Doe') | ||
| 7 | + print(license.content) | ||
| 8 | + # end get | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + ######## | ||
| 2 | + Licenses | ||
| 3 | + ######## | ||
| 4 | + | ||
| 5 | + Use :class:`~gitlab.objects.License` objects to manipulate licenses. The | ||
| 6 | + :attr:`gitlab.Gitlab.licenses` manager object provides helper functions. | ||
| 7 | + | ||
| 8 | + Examples | ||
| 9 | + -------- | ||
| 10 | + | ||
| 11 | + List known licenses: | ||
| 12 | + | ||
| 13 | + .. literalinclude:: licenses.py | ||
| 14 | + :start-after: # list | ||
| 15 | + :end-before: # end list | ||
| 16 | + | ||
| 17 | + Generate a license content for a project: | ||
| 18 | + | ||
| 19 | + .. literalinclude:: licenses.py | ||
| 20 | + :start-after: # get | ||
| 21 | + :end-before: # end get | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments