#NEWLINE# def file_infos( names = None ) : #NEWLINE# #INDENT# '\n    iterates over storage files metadata.\n    note: we put the storage name into the metadata as \'id\'\n\n    :param names: None means "all items"\n                  otherwise give a list of storage item names\n    ' #NEWLINE# storage = current_app . storage #NEWLINE# if ( names is None ) : #NEWLINE# #INDENT# names = list ( storage ) #NEWLINE# #UNINDENT# for name in names : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# with storage . open ( name ) as item : #NEWLINE# #INDENT# meta = dict ( item . meta ) #NEWLINE# if delete_if_lifetime_over ( item , name ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# meta [ 'id' ] = e #NEWLINE# ( yield meta ) #NEWLINE# #UNINDENT# #UNINDENT# except ( OSError , IOError ) as e : #NEWLINE# #INDENT# if ( e . errno != errno . ENOENT ) : #NEWLINE# #INDENT# raise