Repository.get_archive_link (issue #65)

This commit is contained in:
Vincent Jacques
2012-09-08 13:04:43 +02:00
parent f963e6ac91
commit f109c644fd
7 changed files with 130 additions and 1 deletions
+14
View File
@@ -498,6 +498,20 @@ class Repository( GithubObject.GithubObject ):
)
self._useAttributes( data )
def get_archive_link( self, archive_format, ref = GithubObject.NotSet ):
assert isinstance( archive_format, ( str, unicode ) ), archive_format
assert ref is GithubObject.NotSet or isinstance( ref, ( str, unicode ) ), ref
url = self.url + "/" + archive_format
if ref is not GithubObject.NotSet:
url += "/" + ref
headers, data = self._requester.requestAndCheck(
"GET",
url,
None,
None
)
return headers[ "location" ]
def get_assignees( self ):
headers, data = self._requester.requestAndCheck(
"GET",