def load_filters(filters_path):
 filterlist = []
 for filterdir in filters_path:
  if (not os.path.isdir(filterdir)):
   continue
  for filterfile in os.listdir(filterdir):
   filterconfig = ConfigParser.RawConfigParser()
   filterconfig.read(os.path.join(filterdir, filterfile))
   for (name, value) in filterconfig.items('Filters'):
    filterdefinition = [string.strip(s) for s in value.split(',')]
    newfilter = build_filter(*filterdefinition)
    if (newfilter is None):
     continue
    newfilter.name = name
    filterlist.append(newfilter)
 return filterlist

def load_filters ( filters_path ) : filterlist = [ ] for filterdir in filters_path : if ( not os . path . isdir ( filterdir ) ) : continue for filterfile in os . listdir ( filterdir ) : filterconfig = ConfigParser . RawConfigParser ( ) filterconfig . read ( os . path . join ( filterdir , filterfile ) ) for ( name , value ) in filterconfig . items ( 'Filters' ) : filterdefinition = [ string . strip ( s ) for s in value . split ( ',' ) ] newfilter = build_filter ( * filterdefinition ) if ( newfilter is None ) : continue newfilter . name = name filterlist . append ( newfilter ) return filterlist
load filters from a list of directories .