summaryrefslogtreecommitdiff
path: root/gitlab.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2013-12-26 14:02:21 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2013-12-26 14:02:21 +0100
commitdebe41aee6eb53c11ea0e6870becc116947fe17d (patch)
tree0e246e35840e216cb771fd39377c4d6dc1a1f149 /gitlab.py
parent1cc7b176d80e58c1fb5eda2b79a27674b65c0a65 (diff)
downloadgitlab-debe41aee6eb53c11ea0e6870becc116947fe17d.tar.gz
Project.archive(): download tarball of the project
Diffstat (limited to 'gitlab.py')
-rw-r--r--gitlab.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gitlab.py b/gitlab.py
index 7d2df8f..a9447ca 100644
--- a/gitlab.py
+++ b/gitlab.py
@@ -943,6 +943,16 @@ class Project(GitlabObject):
raise GitlabGetError
+ def archive(self, sha=None):
+ url = '/projects/%s/repository/archive' % self.id
+ if sha:
+ url += '?sha=%s' % sha
+ r = self.gitlab.rawGet(url)
+ if r.status_code == 200:
+ return r.content
+
+ raise GitlabGetError
+
class TeamMember(GitlabObject):
_url = '/user_teams/%(team_id)s/members'