summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-12-26 07:39:37 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2016-12-26 07:39:37 +0100
commit064e2b4bb7cb4b1775a78f51ebb46a00c9733af9 (patch)
treeeb3072455b77e2a056beef794788916cd211e49f /gitlab/objects.py
parent745389501281d9bcc069e86b1b41e1936132af27 (diff)
downloadgitlab-064e2b4bb7cb4b1775a78f51ebb46a00c9733af9.tar.gz
Snippet: content() -> raw()
Using the content() method causes conflicts with the API `content` attribute.
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 97a2165..9ae8612 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -1026,7 +1026,7 @@ class Snippet(GitlabObject):
optionalUpdateAttrs = ['title', 'file_name', 'content', 'visibility_level']
shortPrintAttr = 'title'
- def content(self, streamed=False, action=None, chunk_size=1024, **kwargs):
+ def raw(self, streamed=False, action=None, chunk_size=1024, **kwargs):
"""Return the raw content of a snippet.
Args:
@@ -1038,14 +1038,13 @@ class Snippet(GitlabObject):
chunk_size (int): Size of each chunk.
Returns:
- str: The snippet content
+ str: The snippet content.
Raises:
GitlabConnectionError: If the server cannot be reached.
GitlabGetError: If the server fails to perform the request.
"""
- url = ("/snippets/%(snippet_id)s/raw" %
- {'snippet_id': self.id})
+ url = ("/snippets/%(snippet_id)s/raw" % {'snippet_id': self.id})
r = self.gitlab._raw_get(url, **kwargs)
raise_error_from_response(r, GitlabGetError)
return utils.response_content(r, streamed, action, chunk_size)