/usr/bin/whisper-set-aggregation-method is in python-whisper 0.9.15-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #!/usr/bin/python
import os
import sys
import signal
import optparse
try:
import whisper
except ImportError:
raise SystemExit('[ERROR] Please make sure whisper is installed properly')
# Ignore SIGPIPE
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
option_parser = optparse.OptionParser(
usage='%%prog path <%s>' % '|'.join(whisper.aggregationMethods))
(options, args) = option_parser.parse_args()
if len(args) < 2:
option_parser.print_usage()
sys.exit(1)
path = args[0]
aggregationMethod = args[1]
try:
oldAggregationMethod = whisper.setAggregationMethod(path, aggregationMethod)
except IOError, exc:
sys.stderr.write("[ERROR] File '%s' does not exist!\n\n" % path)
option_parser.print_usage()
sys.exit(1)
except whisper.WhisperException, exc:
raise SystemExit('[ERROR] %s' % str(exc))
print 'Updated aggregation method: %s (%s -> %s)' % (path,oldAggregationMethod,aggregationMethod)
|