Back to index

enigmail  1.4.3
printconfigsetting.py
Go to the documentation of this file.
00001 import configobj, sys
00002 
00003 try:
00004     (file, section, key) = sys.argv[1:]
00005 except ValueError:
00006     print "Usage: printconfigsetting.py <file> <section> <setting>"
00007     sys.exit(1)
00008 
00009 c = configobj.ConfigObj(file)
00010 
00011 try:
00012     s = c[section]
00013 except KeyError:
00014     print >>sys.stderr, "Section [%s] not found." % section
00015     sys.exit(1)
00016 
00017 try:
00018     print s[key]
00019 except KeyError:
00020     print >>sys.stderr, "Key %s not found." % key
00021     sys.exit(1)