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/.
8 from StringIO
import StringIO
11 (file, section
, key
) = sys
.argv
[1:]
13 print("Usage: printconfigsetting.py <file> <section> <setting>")
16 with
open(file) as fh
:
17 content
= re
.sub('^\s*;', '#', fh
.read(), flags
=re
.M
)
19 c
= configobj
.ConfigObj(StringIO(content
))
24 print >>sys
.stderr
, "Section [%s] not found." % section
30 print >>sys
.stderr
, "Key %s not found." % key