""" Checks to see if an entry should be filtered out based on subject. """ # Copyright © 2004 Saugus.net, Inc. # All Rights Reserved. # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. retVal=0 # If there's no filter, entry is okay if not context.filter or len(context.filter)==0 or len(context.filter[0])==0: retVal=1 # If a subjectStr is provided, check to see if it's in the subject elif subjectStr: if subjectStr in context.Subject(): retVal=1 # If there's a filter, ensure entry's subject is in it else: for subjectStr in context.filter: if subjectStr in context.Subject(): retVal=1 break # If none of these are true, the entry should be filtered out return retVal