summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 17:25:06 +0100
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 17:25:30 +0100
commit2eac07139eb288cda2dd2d22d191ab3fc1053437 (patch)
tree8704db4cc3531b8c29488748ca4086b9d3dd892d /gitlab/objects.py
parentd3a5701e5d481da452185e7a07d7b53493ed9073 (diff)
downloadgitlab-2eac07139eb288cda2dd2d22d191ab3fc1053437.tar.gz
add a decode method for ProjectFile
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 95e1e45..6e15c3a 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -18,6 +18,7 @@
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
+import base64
import copy
import itertools
import json
@@ -922,6 +923,14 @@ class ProjectFile(GitlabObject):
shortPrintAttr = 'file_path'
getRequiresId = False
+ def decode(self):
+ """Returns the decoded content.
+
+ Returns:
+ (str): the decoded content.
+ """
+ return base64.b64decode(self.content)
+
class ProjectFileManager(BaseManager):
obj_cls = ProjectFile