ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/config_unroller.py
Revision: 1.1
Committed: Fri Feb 1 16:08:43 2013 UTC (12 years, 3 months ago) by nmohr
Content type: text/x-python
Branch: MAIN
CVS Tags: lhcp_UnblindFix, hcp_Unblind, lhcp_11April, LHCP_PreAppFixAfterFreeze, LHCP_PreAppFreeze, HEAD
Log Message:
Small helper to unroll the config

File Contents

# Content
1 #!/usr/bin/env python
2 import os,sys,ROOT
3 from optparse import OptionParser
4 ROOT.gROOT.SetBatch(True)
5
6 #--CONFIGURE---------------------------------------------------------------------
7 argv = sys.argv
8 parser = OptionParser()
9 parser.add_option("-S", "--section", dest="section", default="Cuts",
10 help="Config section")
11 parser.add_option("-V", "--value", dest="var", default="",
12 help="Config value")
13 parser.add_option("-C", "--config", dest="config", default=[], action="append",
14 help="configuration file")
15 (opts, args) = parser.parse_args(argv)
16
17 from myutils import BetterConfigParser
18
19 config = BetterConfigParser()
20 config.read(opts.config)
21 print config.get(opts.section,opts.var)