1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 from configparser
import ConfigParser
, NoOptionError
, NoSectionError
9 (filename
, section
, key
) = sys
.argv
[1:]
11 print("Usage: printconfigsetting.py <filename> <section> <setting>")
18 print(cfg
.get(section
, key
))
20 print("Key %s not found." % key
, file=sys
.stderr
)
22 except NoSectionError
:
23 print("Section [%s] not found." % section
, file=sys
.stderr
)