#NEWLINE# def fetch_index( self ) : #NEWLINE# #INDENT# if ( not self . url ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# index_url = urljoin ( self . url , 'index.json' ) #NEWLINE# response = self . geturl ( index_url ) #NEWLINE# if ( response . status_code != httplib . OK ) : #NEWLINE# #INDENT# message = 'Could not fetch "{}"; recieved "{} {}"' #NEWLINE# self . logger . error ( message . format ( index_url , response . status_code , response . reason ) ) #NEWLINE# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return json . loads ( response . content )