Beispiel #1
0
def run(xml_configuration, indicator_batch, run_name, cache_directory, years):
    from opus_gui.results_manager.run.batch_processor import BatchProcessor
    project = OpusProject()
    project.open(xml_configuration)
    bp = BatchProcessor(project)
    visualizations = get_batch_configuration(project = project,
                                             batch_name = indicator_batch)

    bp.set_data(visualizations=visualizations,
                source_data_name = run_name,
                cache_directory = cache_directory,
                years = eval(years),
                )
    bp.errorCallback = lambda x: x     ##
    bp.finishedCallback = lambda x: x  ## hack to work around BatchProcessor
    bp.run()
    try: import wingdbstub
    except: pass
    option_group = MakeIndicatorsOptionGroup()
    parser = option_group.parser
    (options, args) = parser.parse_args()
    
    if not (options.xml_configuration and
            options.indicator_batch and
            ( options.cache_directory or 
              options.run_name) and
            options.years
            ):
        parser.print_help()
        sys.exit(0)
    
    from opus_gui.results_manager.run.batch_processor import BatchProcessor
    project = OpusProject()
    project.open(options.xml_configuration)
    bp = BatchProcessor(project)
    visualizations = get_batch_configuration(project = project,
                                             batch_name = options.indicator_batch)
    
    bp.set_data(visualizations=visualizations,
                source_data_name = options.run_name,
                cache_directory = options.cache_directory,
                years = eval(options.years),
                )
    bp.errorCallback = lambda x: x     ## 
    bp.finishedCallback = lambda x: x  ## hack to work around BatchProcessor
    bp.run()