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)
|