Finaly do a poor implementation of Github.get_gists

This commit is contained in:
Vincent Jacques
2012-03-19 20:01:46 +01:00
parent 2469c6e1ae
commit a91131be42
4 changed files with 63 additions and 1 deletions
+3 -1
View File
@@ -17,7 +17,8 @@ class Requester:
headers, output = self.__statusCheckedRequest( verb, url, parameters, input )
obviouslyFinished = False
while "link" in headers and "next" in headers[ "link" ] and not obviouslyFinished:
pageCount = 1
while "link" in headers and "next" in headers[ "link" ] and not obviouslyFinished and pageCount < 10:
for link in headers[ "link" ].split( "," ):
if "next" in link:
linkUrl = link.split( ";" )[ 0 ][ : -1 ]
@@ -25,6 +26,7 @@ class Requester:
parameters.update( dict( p.split( "=" ) for p in params.split( "&" ) ) )
break
headers, newOutput = self.__statusCheckedRequest( verb, url, parameters, input )
pageCount += 1
if len( newOutput ) == 0:
obviouslyFinished = True
output += newOutput