def parse_excludes(options, fatal):
 excluded_paths = []
 for flag in options:
  (option, parameter) = flag
  if (option == '--exclude'):
   excluded_paths.append(resolve_parent(parameter))
  elif (option == '--exclude-from'):
   try:
    f = open(resolve_parent(parameter))
   except IOError as e:
    raise fatal(("couldn't read %s" % parameter))
   for exclude_path in f.readlines():
    exclude_path = resolve_parent(exclude_path.strip())
    if exclude_path:
     excluded_paths.append(exclude_path)
 return sorted(frozenset(excluded_paths))

def parse_excludes ( options , fatal ) : excluded_paths = [ ] for flag in options : ( option , parameter ) = flag if ( option == '--exclude' ) : excluded_paths . append ( resolve_parent ( parameter ) ) elif ( option == '--exclude-from' ) : try : f = open ( resolve_parent ( parameter ) ) except IOError as e : raise fatal ( ( "couldn't read %s" % parameter ) ) for exclude_path in f . readlines ( ) : exclude_path = resolve_parent ( exclude_path . strip ( ) ) if exclude_path : excluded_paths . append ( exclude_path ) return sorted ( frozenset ( excluded_paths ) )
traverse the options and extract all excludes .