def main():
    parseOptions()
    #read configuration
    os.environ['PYTHON_LOGGER_VERBOSITY'] =  str(opt.verbosity) #will be checked/used by all Loggers
    cfg_reader = UniversalConfigParser(cfg_type="YAML",file_list = opt.config_filename)
    pp = pprint.PrettyPrinter(indent=4)
    full_config = cfg_reader.get_dict()

    categories = opt.category.split(',')
    for cat in categories:
        datacard_builder = DatacardBuilder(datacard_name = cat , datacard_input = full_config[cat])
        pp.pprint(full_config[cat])
        datacard_builder.scale_lumi_by(opt.scale_lumi_by)
        datacard_builder.make_txt_card()
        datacard_builder.make_workspace()
                #self.doCopyToWebDir(name_animated_gif)

                
                
                
if __name__ == "__main__":
     
    # parse the arguments and options
    #global opt, args
    #parseOptions()
    print "Starting plots..."
    
    pp = pprint.PrettyPrinter(indent=4)
    
    DEBUG = True
    cfg_reader = UniversalConfigParser(cfg_type="YAML",file_list = "plotTotalPdf.yaml")
    cfg_reader.setLogLevel(10) 
    
    plots_data = cfg_reader.get_dict()
    
    if DEBUG: 
	  print "plots_data = ", 
	  pp.pprint(plots_data)
    
    plotter = TotalPdfPlotter()
    plotter.setCopyToWebDir(True,"/afs/cern.ch/user/r/roko/www/html/Geoloc/TotalPdfs/")
    
    for plot_name in plots_data['list_of_plots_to_do']:
	print 'Make plot: ',plot_name
	plotter.setName(plot_name)
	plotter.makePlot(plots_data[plot_name])