| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd7d2f6 commit 7453895
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,10 @@ | |||
| 2 | 2 | snippets = gl.snippets.list() | |
| 3 | 3 | # end list | |
| 4 | 4 | ||
| 5 | + # public list | ||
| 6 | + public_snippets = gl.snippets.public() | ||
| 7 | + # nd public list | ||
| 8 | + | ||
| 5 | 9 | # get | |
| 6 | 10 | snippet = gl.snippets.get(snippet_id) | |
| 7 | 11 | # get the content | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,12 +11,18 @@ You can store code snippets in Gitlab. Snippets can be attached to projects | |||
| 11 | 11 | Examples | |
| 12 | 12 | ======== | |
| 13 | 13 | ||
| 14 | - List snippets: | ||
| 14 | + List snippets woned by the current user: | ||
| 15 | 15 | ||
| 16 | 16 | .. literalinclude:: snippets.py | |
| 17 | 17 | :start-after: # list | |
| 18 | 18 | :end-before: # end list | |
| 19 | 19 | ||
| 20 | + List the public snippets: | ||
| 21 | + | ||
| 22 | + .. literalinclude:: snippets.py | ||
| 23 | + :start-after: # public list | ||
| 24 | + :end-before: # end public list | ||
| 25 | + | ||
| 20 | 26 | Get a snippet: | |
| 21 | 27 | ||
| 22 | 28 | .. literalinclude:: snippets.py | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1054,8 +1054,8 @@ def content(self, streamed=False, action=None, chunk_size=1024, **kwargs): | |||
| 1054 | 1054 | class SnippetManager(BaseManager): | |
| 1055 | 1055 | obj_cls = Snippet | |
| 1056 | 1056 | ||
| 1057 | - def all(self, **kwargs): | ||
| 1058 | - """List all the snippets | ||
| 1057 | + def public(self, **kwargs): | ||
| 1058 | + """List all the public snippets. | ||
| 1059 | 1059 | ||
| 1060 | 1060 | Args: | |
| 1061 | 1061 | all (bool): If True, return all the items, without pagination | |
@@ -1066,18 +1066,6 @@ def all(self, **kwargs): | |||
| 1066 | 1066 | """ | |
| 1067 | 1067 | return self.gitlab._raw_list("/snippets/public", Snippet, **kwargs) | |
| 1068 | 1068 | ||
| 1069 | - def owned(self, **kwargs): | ||
| 1070 | - """List owned snippets. | ||
| 1071 | - | ||
| 1072 | - Args: | ||
| 1073 | - all (bool): If True, return all the items, without pagination | ||
| 1074 | - **kwargs: Additional arguments to send to GitLab. | ||
| 1075 | - | ||
| 1076 | - Returns: | ||
| 1077 | - list(gitlab.Gitlab.Snippet): The list of owned snippets. | ||
| 1078 | - """ | ||
| 1079 | - return self.gitlab._raw_list("/snippets", Snippet, **kwargs) | ||
| 1080 | - | ||
| 1081 | 1069 | ||
| 1082 | 1070 | class Namespace(GitlabObject): | |
| 1083 | 1071 | _url = '/namespaces' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments