config/printconfigsetting.py
author Marco Bonardo <mbonardo@mozilla.com>
Thu, 26 Jan 2012 00:54:25 +0100
changeset 86635 691af0af89da90c91ae9c007c4567ca3815b93ba
parent 2752 bb06c19d18c043e1b2c66aeffb3b1e33205f7378
child 96742 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Bug 720501 - urlInlineComplete should not attempt to case-preserve results, since that interferes with the controller's case-preservation. r=gavin

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)