config/printconfigsetting.py
author Luke Wagner <luke@mozilla.com>
Thu, 07 Jul 2011 15:40:33 -0700
changeset 73898 ba19e1cd3f918d684ad8d71551254631c8d23870
parent 2752 bb06c19d18c043e1b2c66aeffb3b1e33205f7378
permissions -rw-r--r--
Bug 670059 - Add some JS engine telemetry counters to measure occurrences of: E4X, __iterator__, mutable __proto__ (r=taras,waldo)

import configobj, sys

try:
    (file, section, key) = sys.argv[1:]
except ValueError:
    print "Usage: printconfigsetting.py <file> <section> <setting>"
    sys.exit(1)

c = configobj.ConfigObj(file)

try:
    s = c[section]
except KeyError:
    print >>sys.stderr, "Section [%s] not found." % section
    sys.exit(1)

try:
    print s[key]
except KeyError:
    print >>sys.stderr, "Key %s not found." % key
    sys.exit(1)