def filter_filenames_by_info(self, filename_items):
        """Filter out file using metadata from the filenames.

        Currently only uses start and end time. If only start time is available
        from the filename, keep all the filename that have a start time before
        the requested end time.
        """
        for filename, filename_info in filename_items:
            fend = filename_info.get('end_time')
            fstart = filename_info.setdefault('start_time', fend)
            if fend and fend < fstart:
                # correct for filenames with 1 date and 2 times
                fend = fend.replace(year=fstart.year,
                                    month=fstart.month,
                                    day=fstart.day)
                filename_info['end_time'] = fend
            if self.metadata_matches(filename_info):
                yield filename, filename_info
def filter_filenames_by_info ( self , filename_items ) : for filename , filename_info in filename_items : fend = filename_info . get ( 'end_time' ) fstart = filename_info . setdefault ( 'start_time' , fend ) if fend and fend < fstart : fend = fend . replace ( year = fstart . year , month = fstart . month , day = fstart . day ) filename_info [ 'end_time' ] = fend if self . metadata_matches ( filename_info ) : yield filename , filename_info
Filter out file using metadata from the filenames.

        Currently only uses start and end time. If only start time is available
        from the filename, keep all the filename that have a start time before
        the requested end time.