@_ConfigurableFilter(executable='YUI_COMPRESSOR_EXECUTABLE')
def yui_compressor(infile, executable=None):
 yuicompressor = executable
 if (not yuicompressor):
  try:
   subprocess.call('yui-compressor', stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
   yuicompressor = 'yui-compressor'
  except Exception:
   pass
 if (not yuicompressor):
  try:
   subprocess.call('yuicompressor', stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
   yuicompressor = 'yuicompressor'
  except:
   raise Exception('yui-compressor is not installed.')
   return False
 return runinplace('{} --nomunge %1 -o %2'.format(yuicompressor), infile)

@ _ConfigurableFilter ( executable = 'YUI_COMPRESSOR_EXECUTABLE' ) def yui_compressor ( infile , executable = None ) : yuicompressor = executable if ( not yuicompressor ) : try : subprocess . call ( 'yui-compressor' , stdout = open ( os . devnull , 'w' ) , stderr = open ( os . devnull , 'w' ) ) yuicompressor = 'yui-compressor' except Exception : pass if ( not yuicompressor ) : try : subprocess . call ( 'yuicompressor' , stdout = open ( os . devnull , 'w' ) , stderr = open ( os . devnull , 'w' ) ) yuicompressor = 'yuicompressor' except : raise Exception ( 'yui-compressor is not installed.' ) return False return runinplace ( '{} --nomunge %1 -o %2' . format ( yuicompressor ) , infile )
run yui compressor on a file .