示例#1
0
def parseFile(f):
    doc = minidom.parse(f)
    query = [name('commandSetRoot'),
             [name('commandSet'),
              [name('command')]]]

    res = execQuery(query, doc)
    
    times = [r.childNodes[0].data for r in res if r.localName in ['startTime', 'endTime']]

    return [parseTime(end) - parseTime(start) for start, end in chunk(times, 2)]
示例#2
0
def _pipelineProgress(workflowXML):
    doc = _try(lambda : minidom.parse(workflowXML))
    query = [xmlquery.name('commandSetRoot'),
             [xmlquery.name('commandSet'),
              [xmlquery.name('status')]]]
    
    res = xmlquery.execQuery(query, doc)

    total = sum([int(r.childNodes[0].data) for r in res if r.localName == 'total'])
    complete = sum([int(r.childNodes[0].data) for r in res if r.localName == 'complete'])

    return (complete, total)
示例#3
0
文件: pipeline.py 项目: carze/vappio
    def progress(self):
        """
        Returns a tuple of (number of completed tasks, total tasks)
        """
        doc = minidom.parse(os.path.join(self.config("dirs.pipeline_runtime"), str(self.pid), "pipeline.xml"))
        query = [name("commandSetRoot"), [name("commandSet"), [name("status")]]]

        res = execQuery(query, doc)
        total = sum([int(r.childNodes[0].data) for r in res if r.localName == "total"])
        complete = sum([int(r.childNodes[0].data) for r in res if r.localName == "complete"])

        return (complete, total)
def parseFile(f):
    doc = minidom.parse(f)
    query = [name('commandSetRoot'), [name('commandSet'), [name('command')]]]

    res = execQuery(query, doc)

    times = [
        r.childNodes[0].data for r in res
        if r.localName in ['startTime', 'endTime']
    ]

    return [
        parseTime(end) - parseTime(start) for start, end in chunk(times, 2)
    ]
示例#5
0
def _pipelineProgress(workflowXML):
    doc = _try(lambda: minidom.parse(workflowXML))
    query = [
        xmlquery.name('commandSetRoot'),
        [xmlquery.name('commandSet'), [xmlquery.name('status')]]
    ]

    res = xmlquery.execQuery(query, doc)

    total = sum(
        [int(r.childNodes[0].data) for r in res if r.localName == 'total'])
    complete = sum(
        [int(r.childNodes[0].data) for r in res if r.localName == 'complete'])

    return (complete, total)
示例#6
0
文件: pipeline.py 项目: carze/vappio
    def progress(self):
        """
        Returns a tuple of (number of completed tasks, total tasks)
        """
        doc = minidom.parse(
            os.path.join(self.config('dirs.pipeline_runtime'), str(self.pid),
                         'pipeline.xml'))
        query = [
            name('commandSetRoot'), [name('commandSet'), [name('status')]]
        ]

        res = execQuery(query, doc)
        total = sum(
            [int(r.childNodes[0].data) for r in res if r.localName == 'total'])
        complete = sum([
            int(r.childNodes[0].data) for r in res if r.localName == 'complete'
        ])

        return (complete, total)