예제 #1
0
def inputFileHandler(targets):
    """
    _inputFileHandler_

    coroutine to create input files in the report and dispatch
    sub data down the pipeline

    """
    while True:
        report, node = (yield)
        moduleName = None
        moduleNode = [x for x in node.children if x.name == "ModuleLabel"][0]
        moduleName = moduleNode.text

        fileRef = report.addInputFile(moduleName)
        fileAttrs = {}
        for subnode in node.children:
            if subnode.name == "Runs":
                targets['Runs'].send((fileRef, subnode))
            elif subnode.name == "Branches":
                targets['Branches'].send((fileRef, subnode))
            else:
                fileAttrs[subnode.name] = subnode.text

        Report.addAttributesToFile(fileRef, lfn=fileAttrs["LFN"],
                                   pfn=fileAttrs["PFN"], catalog=fileAttrs["Catalog"],
                                   module_label=fileAttrs["ModuleLabel"],
                                   guid=fileAttrs["GUID"], input_type=fileAttrs["InputType"],
                                   input_source_class=fileAttrs["InputSourceClass"],
                                   events=int(fileAttrs["EventsRead"]))
예제 #2
0
def fileHandler(targets):
    """
    _fileHandler_

    coroutine to create files and handle sub data in the appropriate
    dispatchers

    """
    while True:
        report, node = (yield)
        moduleName = None
        moduleNode = [x for x in node.children if x.name == "ModuleLabel"][0]
        moduleName = moduleNode.text

        fileRef = report.addOutputFile(moduleName)
        fileAttrs = {}
        for subnode in node.children:
            if subnode.name == "Inputs":
                targets['Inputs'].send((fileRef, subnode))
            elif subnode.name == "Runs":
                targets['Runs'].send((fileRef, subnode))
            elif subnode.name == "Branches":
                targets['Branches'].send((fileRef, subnode))
            else:
                fileAttrs[subnode.name] = subnode.text

        Report.addAttributesToFile(fileRef, lfn=fileAttrs["LFN"],
                                   pfn=fileAttrs["PFN"], catalog=fileAttrs["Catalog"],
                                   module_label=fileAttrs["ModuleLabel"],
                                   guid=fileAttrs["GUID"],
                                   output_module_class=fileAttrs["OutputModuleClass"],
                                   events=int(fileAttrs["TotalEvents"]),
                                   branch_hash=fileAttrs["BranchHash"])
예제 #3
0
def inputFileHandler(targets):
    """
    _inputFileHandler_

    coroutine to create input files in the report and dispatch
    sub data down the pipeline

    """
    while True:
        report, node = (yield)
        moduleName = None
        moduleNode = [ x for x in node.children if x.name == "ModuleLabel"][0]
        moduleName = moduleNode.text

        moduleRef = report.addInputSource(moduleName)
        fileRef = report.addInputFile(moduleName)
        fileAttrs = {}
        for subnode in node.children:
            if subnode.name == "Runs":
                targets['Runs'].send( (fileRef, subnode) )
            elif subnode.name == "Branches":
                targets['Branches'].send( (fileRef, subnode) )
            else:
                fileAttrs[subnode.name] = subnode.text

        Report.addAttributesToFile(fileRef, lfn = fileAttrs["LFN"],
                                   pfn = fileAttrs["PFN"], catalog = fileAttrs["Catalog"],
                                   module_label = fileAttrs["ModuleLabel"],
                                   guid = fileAttrs["GUID"], input_type = fileAttrs["InputType"],
                                   input_source_class = fileAttrs["InputSourceClass"],
                                   events = int(fileAttrs["EventsRead"]))

        [fileRef]
예제 #4
0
def fileHandler(targets):
    """
    _fileHandler_

    coroutine to create files and handle sub data in the appropriate
    dispatchers

    """
    while True:
        report, node = (yield)
        moduleName = None
        moduleNode = [x for x in node.children if x.name == "ModuleLabel"][0]
        moduleName = moduleNode.text

        moduleRef = report.addOutputModule(moduleName)
        fileRef = report.addOutputFile(moduleName)
        fileAttrs = {}
        for subnode in node.children:
            if subnode.name == "Inputs":
                targets["Inputs"].send((fileRef, subnode))
            elif subnode.name == "Runs":
                targets["Runs"].send((fileRef, subnode))
            elif subnode.name == "Branches":
                targets["Branches"].send((fileRef, subnode))
            else:
                fileAttrs[subnode.name] = subnode.text

        Report.addAttributesToFile(
            fileRef,
            lfn=fileAttrs["LFN"],
            pfn=fileAttrs["PFN"],
            catalog=fileAttrs["Catalog"],
            module_label=fileAttrs["ModuleLabel"],
            guid=fileAttrs["GUID"],
            ouput_module_class=fileAttrs["OutputModuleClass"],
            events=int(fileAttrs["TotalEvents"]),
            branch_hash=fileAttrs["BranchHash"],
        )

        [fileRef]