Loading tools/roomservice.py +12 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ import os import sys import urllib2 import json import netrc, base64 from xml.etree import ElementTree product = sys.argv[1]; Loading @@ -11,9 +12,19 @@ print "Device %s not found. Attempting to retrieve device repository from Cyanog repositories = [] authtuple = netrc.netrc().authenticators("api.github.com") if authtuple: githubauth = base64.encodestring('%s:%s' % (authtuple[0], authtuple[2])).replace('\n', '') else: githubauth = None page = 1 while True: result = json.loads(urllib2.urlopen("https://api.github.com/users/CyanogenMod/repos?page=%d" % page).read()) githubreq = urllib2.Request("https://api.github.com/users/CyanogenMod/repos?per_page=100&page=%d" % page) if githubauth: githubreq.add_header("Authorization","Basic %s" % githubauth) result = json.loads(urllib2.urlopen(githubreq).read()) if len(result) == 0: break for res in result: Loading Loading
tools/roomservice.py +12 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ import os import sys import urllib2 import json import netrc, base64 from xml.etree import ElementTree product = sys.argv[1]; Loading @@ -11,9 +12,19 @@ print "Device %s not found. Attempting to retrieve device repository from Cyanog repositories = [] authtuple = netrc.netrc().authenticators("api.github.com") if authtuple: githubauth = base64.encodestring('%s:%s' % (authtuple[0], authtuple[2])).replace('\n', '') else: githubauth = None page = 1 while True: result = json.loads(urllib2.urlopen("https://api.github.com/users/CyanogenMod/repos?page=%d" % page).read()) githubreq = urllib2.Request("https://api.github.com/users/CyanogenMod/repos?per_page=100&page=%d" % page) if githubauth: githubreq.add_header("Authorization","Basic %s" % githubauth) result = json.loads(urllib2.urlopen(githubreq).read()) if len(result) == 0: break for res in result: Loading