#NEWLINE# def _get_data( self , rtype , last_key , **kwargs ) : #NEWLINE# #INDENT# params = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# params [ 'per_page' ] = ITEMS_PER_PAGE #NEWLINE# params [ 'page' ] = ( ( last_key + 1 ) if last_key else 1 ) #NEWLINE# if ( rtype == 'zones' ) : #NEWLINE# #INDENT# path = ( API_ROOT + 'zones.xml' ) #NEWLINE# response = self . connection . request ( path ) #NEWLINE# transform_func = self . _to_zones #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( rtype == 'records' ) : #NEWLINE# #INDENT# zone = kwargs [ 'zone' ] #NEWLINE# path = ( API_ROOT + ( 'zones/%s/hosts.xml' % zone . id ) ) #NEWLINE# self . connection . set_context ( { #NEWLINE# #INDENT# 'resource' : 'zone' , #NEWLINE# 'id' : zone . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = self . connection . request ( path , params = params ) #NEWLINE# transform_func = self . _to_records #NEWLINE# #UNINDENT# #UNINDENT# exhausted = False #NEWLINE# result_count = int ( response . headers . get ( 'x-query-count' , 0 ) ) #NEWLINE# if ( ( params [ 'page' ] * ITEMS_PER_PAGE ) >= result_count ) : #NEWLINE# #INDENT# exhausted = True #NEWLINE# #UNINDENT# if ( response . status == httplib . OK ) : #NEWLINE# #INDENT# items = transform_func ( elem = response . object , ** kwargs ) #NEWLINE# return ( items , params [ 'page' ] , self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( [ ] , None , True )