def optimize_images(pelican):
 for (dirpath, _, filenames) in os.walk(pelican.settings['OUTPUT_PATH']):
  for name in filenames:
   if (os.path.splitext(name)[1] in COMMANDS.keys()):
    optimize(dirpath, name)

def optimize_images ( pelican ) : for ( dirpath , _ , filenames ) in os . walk ( pelican . settings [ 'OUTPUT_PATH' ] ) : for name in filenames : if ( os . path . splitext ( name ) [ 1 ] in COMMANDS . keys ( ) ) : optimize ( dirpath , name )
optimized jpg and png images .