def compress (input_filename, output_filename=None, verbose=False):
  """compress(input_filename, output_filename=None, verbose=False) -> integer

  Uses zlib to compress input_filename and store the result in
  output_filename.  The size of output_filename is returned on
  success; zero is returned on failure.

  The input file is compressed in one fell swoop.  The output_filename
  defaults to input_filename + ".ait-zlib".

  If verbose is True, compress() will use ait.core.log.info() to
  report compression statistics.
  """
  input_size  = 0
  output_size = 0

  if output_filename is None:
    output_filename = input_fillename + '.ait-zlib'

  try:
    stream     = open(input_filename , 'rb')
    output     = open(output_filename, 'wb')
    bytes      = stream.read()
    input_size = len(bytes)

    if verbose:
      log.info("Compressing %s (%d bytes).", input_filename, input_size)

    compressed  = zlib.compress(bytes, 3)
    output_size = len(compressed)
    output.write(compressed)

    stream.close()
    output.close()

    percent = (1.0 - (output_size / float(input_size) )) * 100

    if verbose:
      log.info("Wrote %s (%d bytes).", output_filename, output_size)
      log.info("Compressed %6.2f percent", percent)

  except (IOError, OSError), e:
    log.error(str(e) + ".")

  return output_size
compress(input_filename, output_filename=None, verbose=False) -> integer

  Uses zlib to compress input_filename and store the result in
  output_filename.  The size of output_filename is returned on
  success; zero is returned on failure.

  The input file is compressed in one fell swoop.  The output_filename
  defaults to input_filename + ".ait-zlib".

  If verbose is True, compress() will use ait.core.log.info() to
  report compression statistics.