diff options
author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2016-01-23 17:25:06 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2016-01-23 17:25:30 +0100 |
commit | 2eac07139eb288cda2dd2d22d191ab3fc1053437 (patch) | |
tree | 8704db4cc3531b8c29488748ca4086b9d3dd892d /gitlab/objects.py | |
parent | d3a5701e5d481da452185e7a07d7b53493ed9073 (diff) | |
download | gitlab-2eac07139eb288cda2dd2d22d191ab3fc1053437.tar.gz |
add a decode method for ProjectFile
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r-- | gitlab/objects.py | 9 |
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 |