#NEWLINE# def image_list_detailed( request , marker = None , sort_dir = 'desc' , sort_key = 'created_at' , filters = None , paginate = False ) : #NEWLINE# #INDENT# limit = getattr ( settings , 'API_RESULT_LIMIT' , 1000 ) #NEWLINE# page_size = utils . get_page_size ( request ) #NEWLINE# if paginate : #NEWLINE# #INDENT# request_size = ( page_size + 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# request_size = limit #NEWLINE# #UNINDENT# kwargs = { #NEWLINE# #INDENT# 'filters' : ( filters or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , #NEWLINE# #UNINDENT# } #NEWLINE# if marker : #NEWLINE# #INDENT# kwargs [ 'marker' ] = marker #NEWLINE# #UNINDENT# kwargs [ 'sort_dir' ] = sort_dir #NEWLINE# kwargs [ 'sort_key' ] = sort_key #NEWLINE# images_iter = glanceclient ( request ) . images . list ( page_size = request_size , limit = limit , ** kwargs ) #NEWLINE# has_prev_data = False #NEWLINE# has_more_data = False #NEWLINE# if paginate : #NEWLINE# #INDENT# images = list ( itertools . islice ( images_iter , request_size ) ) #NEWLINE# if ( len ( images ) > page_size ) : #NEWLINE# #INDENT# images . pop ( ( - 1 ) ) #NEWLINE# has_more_data = True #NEWLINE# if ( marker is not None ) : #NEWLINE# #INDENT# has_prev_data = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( sort_dir == 'asc' ) and ( marker is not None ) ) : #NEWLINE# #INDENT# has_more_data = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( marker is not None ) : #NEWLINE# #INDENT# has_prev_data = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# images = list ( images_iter ) #NEWLINE# #UNINDENT# return ( images , has_more_data , has_prev_data )