From debe41aee6eb53c11ea0e6870becc116947fe17d Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Thu, 26 Dec 2013 14:02:21 +0100 Subject: Project.archive(): download tarball of the project --- gitlab.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gitlab.py') 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' -- cgit v1.2.1