def on_cleanup_list(filename, skip_nzb=False):
 lst = cfg.cleanup_list()
 if lst:
  (name, ext) = os.path.splitext(filename)
  ext = ext.strip().lower()
  name = name.strip()
  for k in lst:
   item = k.strip().strip('.').lower()
   item = ('.' + item)
   if (((item == ext) or ((ext == '') and (item == name))) and (not (skip_nzb and (item == '.nzb')))):
    return True
 return False

def on_cleanup_list ( filename , skip_nzb = False ) : lst = cfg . cleanup_list ( ) if lst : ( name , ext ) = os . path . splitext ( filename ) ext = ext . strip ( ) . lower ( ) name = name . strip ( ) for k in lst : item = k . strip ( ) . strip ( '.' ) . lower ( ) item = ( '.' + item ) if ( ( ( item == ext ) or ( ( ext == '' ) and ( item == name ) ) ) and ( not ( skip_nzb and ( item == '.nzb' ) ) ) ) : return True return False
return true if a filename matches the clean-up list .