Repository: tags, branches, commits

I had to rework pagination because it does not work as documented
This commit is contained in:
Vincent Jacques
2012-02-25 15:08:07 +00:00
parent 8a7ab941cd
commit bd8c8f5886
5 changed files with 117 additions and 15 deletions
+6 -3
View File
@@ -18,12 +18,15 @@ class Requester:
headers, output = self.__statusCheckedRequest( verb, url, parameters, input )
page = 2
while "link" in headers and "next" in headers[ "link" ]:
parameters[ "page" ] = page
for link in headers[ "link" ].split( "," ):
if "next" in link:
linkUrl = link.split( ";" )[ 0 ][ : -1 ]
params = linkUrl.split( "?" )[ 1 ]
parameters.update( dict( p.split( "=" ) for p in params.split( "&" ) ) )
break
headers, newOutput = self.__statusCheckedRequest( verb, url, parameters, input )
output += newOutput
page += 1
return output