FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add licenses API · cryptopsy30/python-gitlab@4540614 · GitHub

Repository navigation

Commit 4540614

Browse files
Gauvain Pocentek
committed
docs: add licenses API
1 parent 31882b8 commit 4540614

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎docs/api-objects.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ API objects manipulation
1313
gl_objects/groups
1414
gl_objects/issues
1515
gl_objects/labels
16+
gl_objects/licenses
1617
gl_objects/namespaces
1718
gl_objects/projects
1819
gl_objects/runners

‎docs/gl_objects/licenses.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

‎docs/gl_objects/licenses.rst‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL