'Process an entry and reject it if it doesn\'t pass filter.
:param task: Task entry belongs to.
:param entry: Entry to process
:return: True, if entry was rejected.'

def process_entry(self, task, entry, config):

    if (u'content_files' in entry):
        files = entry[u'content_files']
        log.debug((u'%s    files:    %s' % (entry[u'title'], files)))
        def matching_mask(files, masks):
            u'Returns    matching    mask    if    any    files    match    any    of    the    masks,    false    otherwise'
            for file in files:
                for mask in masks:
                    if fnmatch(file, mask):
                        return mask
            return False
        if config.get(u'require'):
            if (not matching_mask(files, config[u'require'])):
                log.info((u'Entry    %s    does    not    have    any    of    the    required    filetypes,    rejecting' % entry[u'title']))
                entry.reject(u'does    not    have    any    of    the    required    filetypes', remember=True)
                return True
        if config.get(u'require_all'):
            if (not all((any((fnmatch(file, mask) for file in files)) for mask in config[u'require_all']))):
                log.info((u'Entry    %s    does    not    have    all    of    the    required    filetypes,    rejecting' % entry[u'title']))
                entry.reject(u'does    not    have    all    of    the    required    filetypes', remember=True)
                return True
        if config.get(u'reject'):
            mask = matching_mask(files, config[u'reject'])
            if mask:
                log.info((u'Entry    %s    has    banned    file    %s,    rejecting' % (entry[u'title'], mask)))
                entry.reject((u'has    banned    file    %s' % mask), remember=True)
                return True
        if (config.get(u'require_mainfile') and (len(files) > 1)):
            best = None
            for f in entry[u'torrent'].get_filelist():
                if ((not best) or (f[u'size'] > best)):
                    best = f[u'size']
            if (((100 * float(best)) / float(entry[u'torrent'].size)) < 90):
                log.info((u'Entry    %s    does    not    have    a    main    file,    rejecting' % entry[u'title']))
                entry.reject(u'does    not    have    a    main    file', remember=True)
                return True
