def handle_extensions(extensions=('html',), ignored=('py',)):
 ext_list = []
 for ext in extensions:
  ext_list.extend(ext.replace(' ', '').split(','))
 for (i, ext) in enumerate(ext_list):
  if (not ext.startswith('.')):
   ext_list[i] = ('.%s' % ext_list[i])
 return set([x for x in ext_list if (x.strip('.') not in ignored)])

def handle_extensions ( extensions = ( 'html' , ) , ignored = ( 'py' , ) ) : ext_list = [ ] for ext in extensions : ext_list . extend ( ext . replace ( ' ' , '' ) . split ( ',' ) ) for ( i , ext ) in enumerate ( ext_list ) : if ( not ext . startswith ( '.' ) ) : ext_list [ i ] = ( '.%s' % ext_list [ i ] ) return set ( [ x for x in ext_list if ( x . strip ( '.' ) not in ignored ) ] )
organizes multiple extensions that are separated with commas or passed by using --extension/-e multiple times .