+def makeParser(usage=""):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--bins", type="int", dest="bins")
+ parser.add_option("--field", type="int", dest="binnedField")
+ parser.add_option("--binSize", type="float", dest="binLength")
+ parser.add_option("--doLog", type="int", dest="logBase")
+ parser.add_option("--ymax", type="int", dest="maxY")
+ parser.add_option("--xlabel", dest="xLabel")
+ parser.add_option("--ylabel", dest="yLabel")
+ parser.add_option("--binLabels", dest="binLabels", help="comma separated list")
+ parser.add_option("--title", dest="figTitle")
+ parser.add_option("--legend", dest="barsLegend", help="comma separated list")
+ parser.add_option("--xoffset", type="float", dest="pointOffset")
+ parser.add_option("--figsize", dest="figSizes", help="x,y pair")
+
+ configParser = getConfigParser()
+ section = "plotbardist"
+ bins = getConfigIntOption(configParser, section, "bins", 10)
+ binnedField = getConfigIntOption(configParser, section, "binnedField", -1)
+ binLength = getConfigIntOption(configParser, section, "binLength", -1)
+ logBase = getConfigOption(configParser, section, "logBase", None)
+ maxY = getConfigIntOption(configParser, section, "maxY", 0)
+ xLabel = getConfigOption(configParser, section, "xLabel", "bins")
+ yLabel = getConfigOption(configParser, section, "yLabel", "count")
+ binLabels = getConfigOption(configParser, section, "binLabels", None)
+ figTitle = getConfigOption(configParser, section, "figTitle", "")
+ barsLegend = getConfigOption(configParser, section, "barsLegend", None)
+ pointOffset = getConfigFloatOption(configParser, section, "pointOffset", 0.)
+ figSizes = getConfigOption(configParser, section, "figSizes", None)
+
+ parser.set_defaults(bins=bins, binnedField=binnedField, binLength=binLength, logBase=logBase, maxY=maxY,
+ xLabel=xLabel, yLabel=yLabel, binLabels=binLabels, figTitle=figTitle,
+ barsLegend=barsLegend, pointOffset=pointOffset, figSizes=figSizes)
+
+ return parser
+
+