Example #1
0
    def output(self, runlist, dic, dicsum, xmlhtmlstr, roothtmlstr):

        if self.html:

            with timer('GetOKS link info'):
                from AtlRunQuerySFO import SetOKSLinks
                SetOKSLinks(runlist)

            # create web page
            from .html.AtlRunQueryHTML import ResultPageMaker
            #try:
            pageinfo = {
                'datapath': self.datapath,
                'origQuery': self.origQuery,
                'fullQuery': self.parsedstring,
                'runlist': runlist,
                'dic': dic,
                'dicsum': dicsum,
                'makeSummary': self.makeSummary,
                'makeDQeff': self.makeDQeff,
                'makeDQSummary': self.makeDQSummary,
                'makeDQPlots': self.makeDQPlots,
                'roothtmlstr': roothtmlstr,
                'xmlfilename': self.xmlFileName,
                'xmlhtmlstr': xmlhtmlstr,
                'querytime': time() - self.querystart,
                'selout': self.selectionOutput,
            }
            with timer("run ResultPageMaker makePage"):
                ResultPageMaker.makePage(pageinfo)
            #except ImportError, ie:
            #    print "Can't import pagemaker, no web page made",ie

        else:
            print '---------------------------------------------------------------------'
            print Run.header()
            runlist.reverse()
            for r in runlist:
                print r

            from CoolRunQuery.utils.AtlRunQueryUtils import addKommaToNumber, filesize
            print 'Summary:'
            for data_key, summary in dicsum.items():
                if data_key.Type == DataKey.STREAM:
                    key = data_key.ResultKey.replace('STR:', '')
                    val = '%s (%s)' % (addKommaToNumber(
                        summary[0]), filesize(summary[1]))
                else:
                    key = data_key.ResultKey
                    val = addKommaToNumber(summary)
                print '%20s : %s' % (key, val)
            duration = time() - self.querystart
            print "%20s : %g sec" % ('Total execution time', duration)
            print '---------------------------------------------------------------------'
    def _makeResultsTable( cls, pageinfo ):
        for x in pageinfo.keys():
            exec("%s = pageinfo['%s']" % (x,x) )

        # run results table
        resultstable = '<table class="resulttable" id="resulttable" style="margin-left: 13px">\n'

        # table head
        resultstable += Run.header()

        # runs
        with timer("print the runs"):
            for r in runlist:
                with timer("print run %i" % r.runNr):
                    resultstable += str(r)

        # summary
        headlist = Run.headerkeys()
        resultstable += "  <tr class=\"space\"><td style=\"text-align: left;\" colspan=\"%i\"><font size=-2><i>Summary</i>:</font></td></tr>\n" % (len(headlist)-1)
        resultstable += "  <tr class=\"sum\">" + sumstr + "</tr>\n"
        resultstable += "</table>\n"
        return resultstable