• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python html.body函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中py.xml.html.body函数的典型用法代码示例。如果您正苦于以下问题:Python body函数的具体用法?Python body怎么用?Python body使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了body函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _generate_html

def _generate_html(pages):
    """Generate html for given pages.

    :param pages: list of `Page.class`
    :return: path to tempdir.
    :rtype: string.
    """
    tempdir = tempfile.mkdtemp()

    doc = html.html(
        html.head(
            # python don't allow keyword args with hypens
            html.meta(content="text/html; charset=utf-8", **{"http-equiv": "Content-Type"}),
            _get_tile(html, pages)
        ),
        html.body(
            html.div(_generate_body(html, pages, tempdir), id='article'),
        )
    )

    with open(os.path.join(tempdir, 'histmag.html'), 'wb') as out_file:
        logger.debug(
            'Saving generated html to {file}'.format(file=os.path.join(tempdir, 'histmag.html'))
        )
        out_file.write(doc.unicode(indent=2).encode('utf8'))

    return tempdir
开发者ID:krzysztofzuraw,项目名称:histmag_to_kindle,代码行数:27,代码来源:generator.py


示例2: make_html_report

def make_html_report(path, report):
    def tabelize(value):
        try:
            rows = []
            for key in value.keys():
                rows.append(html.tr(html.td(html.pre(key)), html.td(tabelize(value[key]))))
            return html.table(rows)
        except AttributeError:
            if type(value) == type([]):
                return html.table(map(tabelize, value))
            else:
                return html.pre(value)

    body_els = []
    keys = report.keys()
    keys.sort()
    links = []
    for key in keys:
        links.append(html.li(html.a(key, href="#" + key)))
    body_els.append(html.ul(links))
    for key in keys:
        body_els.append(html.a(html.h1(key), id=key))
        body_els.append(tabelize(report[key]))
    with open(path, 'w') as f:
        doc = html.html(html.head(html.style('table, td {border: 1px solid;}')), html.body(body_els))
        f.write(str(doc))
开发者ID:Mozilla-TWQA,项目名称:fxos-certsuite,代码行数:26,代码来源:cert.py


示例3: make_body

    def make_body(self):
        body_parts = [
            html.h1("FirefoxOS Certification Suite Report: %s"
                % self.results.name),
            ]

        if self.results.has_errors:
            body_parts.append(html.h2("Errors During Run"))
            body_parts.append(self.make_errors_table(self.results.errors))
        if self.results.has_regressions:
            body_parts.append(html.h2("Test Regressions"))
            body_parts.append(self.make_regression_table())
        #if self.results.has('files'):
        #    body_parts.append(html.h2("Details information"))
        #    details = []
        #    files = self.results.get('files')
        #    for key in files.keys():
        #        href = '#'
        #        if key[-4:] == 'html' or key[-3:] == 'htm':
        #            href = 'data:text/html;charset=utf-8;base64,%s' % base64.b64encode(files[key])
        #        else:
        #            href = 'data:text/plain;charset=utf-8;base64,%s' % base64.b64encode(files[key])
        #        details.append(html.li(html.a(key, href=href, target='_blank')))
        #    body_parts.append(html.ul(details))

        return html.body(body_parts)
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:26,代码来源:subsuite.py


示例4: startDocument

 def startDocument(self):
     h = html.html()
     self.head = head = html.head()
     self.title = title = html.title(self.title)
     self._push(h)
     h.append(head)
     h.append(title)
     self.body = body = html.body()
     self._push(body)
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:9,代码来源:transform.py


示例5: simple_list_project

    def simple_list_project(self):
        request = self.request
        name = self.context.name
        # we only serve absolute links so we don't care about the route's slash
        abort_if_invalid_projectname(request, name)
        stage = self.context.stage
        if stage.get_projectname(name) is None:
            # we return 200 instead of !=200 so that pip/easy_install don't
            # ask for the full simple page although we know it doesn't exist
            # XXX change that when pip-6.0 is released?
            abort(request, 200, "no such project %r" % name)

        projectname = self.context.projectname
        try:
            result = stage.get_releaselinks(projectname)
        except stage.UpstreamError as e:
            threadlog.error(e.msg)
            abort(request, 502, e.msg)
        links = []
        for link in result:
            relpath = link.entrypath
            href = "/" + relpath
            href = URL(request.path_info).relpath(href)
            if link.eggfragment:
                href += "#egg=%s" % link.eggfragment
            elif link.hash_spec:
                href += "#" + link.hash_spec
            links.extend([
                 "/".join(relpath.split("/", 2)[:2]) + " ",
                 html.a(link.basename, href=href),
                 html.br(), "\n",
            ])
        title = "%s: links for %s" % (stage.name, projectname)
        if stage.has_pypi_base(projectname):
            refresh_title = "Refresh" if stage.ixconfig["type"] == "mirror" else \
                            "Refresh PyPI links"
            refresh_url = request.route_url(
                "/{user}/{index}/+simple/{name}/refresh",
                user=self.context.username, index=self.context.index,
                name=projectname)
            refresh_form = [
                html.form(
                    html.input(
                        type="submit", value=refresh_title, name="refresh"),
                    action=refresh_url,
                    method="post"),
                "\n"]
        else:
            refresh_form = []
        return Response(html.html(
            html.head(
                html.title(title)),
            html.body(
                html.h1(title), "\n",
                refresh_form,
                links)).unicode(indent=2))
开发者ID:uceo,项目名称:uceo-2015,代码行数:56,代码来源:views.py


示例6: make_body

 def make_body(self):
     body_parts = [html.div(
         html.h1("FirefoxOS Certification Suite Report"),
         html.p("Run at %s" % self.time.strftime("%Y-%m-%d %H:%M:%S"))
         )]
     if self.summary_results.has_errors:
         body_parts.append(html.h2("Errors During Run"))
         body_parts.append(self.make_errors_table(self.summary_results.errors))
     body_parts.append(self.make_result_table())
     return html.body(body_parts)
开发者ID:Mozilla-TWQA,项目名称:fxos-certsuite,代码行数:10,代码来源:summary.py


示例7: simple_html_body

def simple_html_body(title, bodytags):
    return html.html(
        html.head(
            html.title(title)
        ),
        html.body(
            html.h1(title),
            *bodytags
        )
    )
开发者ID:zerotired,项目名称:devpi,代码行数:10,代码来源:views.py


示例8: simple_list_project

    def simple_list_project(self):
        request = self.request
        name = self.context.name
        # we only serve absolute links so we don't care about the route's slash
        abort_if_invalid_projectname(request, name)
        stage = self.context.stage
        projectname = stage.get_projectname(name)
        if projectname is None:
            abort(request, 200, "no such project %r" % projectname)

        if name != projectname:
            redirect("/%s/+simple/%s/" % (stage.name, projectname))
        try:
            result = stage.get_releaselinks(projectname)
        except stage.UpstreamError as e:
            threadlog.error(e.msg)
            abort(request, 502, e.msg)
        links = []
        for link in result:
            relpath = link.entrypath
            href = "/" + relpath
            href = URL(request.path).relpath(href)
            if link.eggfragment:
                href += "#egg=%s" % link.eggfragment
            elif link.md5:
                href += "#md5=%s" % link.md5
            links.extend([
                 "/".join(relpath.split("/", 2)[:2]) + " ",
                 html.a(link.basename, href=href),
                 html.br(), "\n",
            ])
        title = "%s: links for %s" % (stage.name, projectname)
        if stage.has_pypi_base(projectname):
            refresh_title = "Refresh" if stage.ixconfig["type"] == "mirror" else \
                            "Refresh PyPI links"
            refresh_url = request.route_url(
                "/{user}/{index}/+simple/{name}/refresh",
                user=self.context.username, index=self.context.index,
                name=projectname)
            refresh_form = [
                html.form(
                    html.input(
                        type="submit", value=refresh_title, name="refresh"),
                    action=refresh_url,
                    method="post"),
                "\n"]
        else:
            refresh_form = []
        return Response(html.html(
            html.head(
                html.title(title)),
            html.body(
                html.h1(title), "\n",
                refresh_form,
                links)).unicode(indent=2))
开发者ID:t-8ch,项目名称:devpi,代码行数:55,代码来源:views.py


示例9: create_unknown_html

def create_unknown_html(path):
    h = html.html(
        html.head(
            html.title('Can not display page'),
            style,
        ),
        html.body(
            html.p('The data URL (%s) does not contain Python code.' % (path,))
        ),
    )
    return h.unicode()
开发者ID:mickg10,项目名称:DARLAB,代码行数:11,代码来源:html.py


示例10: simple_html_body

def simple_html_body(title, bodytags, extrahead=""):
    return html.html(
        html.head(
            html.title(title),
            extrahead,
        ),
        html.body(
            html.h1(title), "\n",
            bodytags
        )
    )
开发者ID:kenatbasis,项目名称:devpi,代码行数:11,代码来源:views.py


示例11: make_body

    def make_body(self):
        body_parts = [html.h1("FirefoxOS Certification Suite Report: %s" % self.results.name)]

        if self.results.has_errors:
            body_parts.append(html.h2("Errors During Run"))
            body_parts.append(self.make_errors_table(self.results.errors))
        if self.results.has_regressions:
            body_parts.append(html.h2("Test Regressions"))
            body_parts.append(self.make_regression_table())

        return html.body(
            body_parts
        )
开发者ID:Mozilla-TWQA,项目名称:fxos-certsuite,代码行数:13,代码来源:subsuite.py


示例12: __init__

    def __init__(self, title=None): 

        self.body = html.body()
        self.head = html.head()
        self.doc = html.html(self.head, self.body)
        if title is not None: 
            self.head.append(
                html.meta(name="title", content=title))
        self.head.append(
            html.link(rel="Stylesheet", type="text/css", href="MochiKit-1.1/examples/sortable_tables/sortable_tables.css"))
        self.head.append(
                    html.script(rel="JavaScript", type="text/javascript", src="MochiKit-1.1/lib/MochiKit/MochiKit.js"))
        self.head.append(
            html.script(rel="JavaScript", type="text/javascript", src="MochiKit-1.1/examples/sortable_tables/sortable_tables.js"))
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:14,代码来源:pybench.py


示例13: pytest_sessionfinish

    def pytest_sessionfinish(self, session, exitstatus):
        self._make_report_dir()
        logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8')

        suite_stop_time = time.time()
        suite_time_delta = suite_stop_time - self.suite_start_time
        numtests = self.passed + self.failed
        generated = datetime.datetime.now()
        doc = html.html(
            html.head(
                html.meta(charset='utf-8'),
                html.title('Test Report'),
                html.link(rel='stylesheet', href='style.css'),
                html.script(src='jquery.js'),
                html.script(src='main.js')),

            html.body(
                html.p('Report generated on %s at %s ' % (
                    generated.strftime('%d-%b-%Y'),
                    generated.strftime('%H:%M:%S'),
                )),
                html.div([html.p(
                    html.span('%i tests' % numtests, class_='all clickable'),
                    ' ran in %i seconds.' % suite_time_delta,
                    html.br(),
                    html.span('%i passed' % self.passed, class_='passed clickable'), ', ',
                    html.span('%i skipped' % self.skipped, class_='skipped clickable'), ', ',
                    html.span('%i failed' % self.failed, class_='failed clickable'), ', ',
                    html.span('%i errors' % self.errors, class_='error clickable'), '.',
                    html.br(), ),
                    html.span('Hide all errors', class_='clickable hide_all_errors'), ', ',
                    html.span('Show all errors', class_='clickable show_all_errors'),
                ], id='summary-wrapper'),
                html.div(id='summary-space'),
                html.table([
                    html.thead(html.tr([
                        html.th('Result', class_='sortable', col='result'),
                        html.th('Class', class_='sortable', col='class'),
                        html.th('Name', class_='sortable', col='name'),
                        html.th('Duration', class_='sortable numeric', col='duration'),
                        # html.th('Output')]), id='results-table-head'),
                        html.th('Links')]), id='results-table-head'),
                    html.tbody(*self.test_logs, id='results-table-body')], id='results-table')))
        logfile.write(
            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' + doc.unicode(
                indent=2))
        logfile.close()
        self.process_screenshot_files()
        self.process_debug_event_files()
        self.process_performance_files()
开发者ID:salsita,项目名称:shishito,代码行数:50,代码来源:junithtml.py


示例14: make_body

    def make_body(self):
        body_parts = [html.div(
             html.script(raw(pkg_resources.resource_string(
                rcname, os.path.sep.join(['resources', 'htmlreport', 
                    'jquery.js']))),
                type='text/javascript'),
            html.script(raw(pkg_resources.resource_string(
                rcname, os.path.sep.join(['resources', 'htmlreport', 
                    'main.js']))),
                type='text/javascript'),
            html.h1("FirefoxOS Certification Suite Report"),
            html.p("Run at %s" % self.time.strftime("%Y-%m-%d %H:%M:%S"))
            )]
        if self.logs:
            device_profile_object = None
            with open(self.logs[-1]) as f:
                device_profile_object = json.load(f)['result']['contact']
            device_profile = [html.h2('Device Information')]
            device_table = html.table()
            for key in device_profile_object:
                device_table.append(
                    html.tr(
                        html.td(key),
                        html.td(device_profile_object[key])
                    )
                )
                #device_profile.append(html.p("%s, %s"% (key, device_profile_object[key])))
            device_profile.append(device_table)
            body_parts.extend(device_profile);

        if self.summary_results.has_errors:
            body_parts.append(html.h2("Errors During Run"))
            body_parts.append(self.make_errors_table(self.summary_results.errors))
        body_parts.append(html.h2("Test Results"))
        body_parts.append(self.make_result_table())

        if self.logs:
            ulbody = [];
            for log_path in self.logs:
                details_log = ''
                with open(log_path, 'r') as f:
                    details_log = f.read()
                href = 'data:text/plain;charset=utf-8;base64,%s' % base64.b64encode(details_log)
                ulbody.append(html.li(html.a(os.path.basename(log_path), href=href, target='_blank')))
            device_profile_object = None
            body_parts.append(html.h2("Details log information"))
            body_parts.append(html.ul(ulbody))
        return html.body(body_parts)
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:48,代码来源:summary.py


示例15: create_dir_html

def create_dir_html(path, href_prefix=''):
    h = html.html(
        html.head(
            html.title('directory listing of %s' % (path,)),
            style,
        ),
    )
    body = html.body(
        html.h1('directory listing of %s' % (path,)),
    )
    h.append(body)
    table = html.table()
    body.append(table)
    tbody = html.tbody()
    table.append(tbody)
    items = list(path.listdir())
    items.sort(key=lambda p: p.basename)
    items.sort(key=lambda p: not p.check(dir=True))
    for fpath in items:
        tr = html.tr()
        tbody.append(tr)
        td1 = html.td(fpath.check(dir=True) and 'D' or 'F', class_='type')
        tr.append(td1)
        href = fpath.basename
        if href_prefix:
            href = '%s%s' % (href_prefix, href)
        if fpath.check(dir=True):
            href += '/'
        td2 = html.td(html.a(fpath.basename, href=href), class_='name')
        tr.append(td2)
        td3 = html.td(time.strftime('%Y-%m-%d %H:%M:%S',
                      time.gmtime(fpath.mtime())), class_='mtime')
        tr.append(td3)
        if fpath.check(dir=True):
            size = ''
            unit = ''
        else:
            size = fpath.size()
            unit = 'B'
            for u in ['kB', 'MB', 'GB', 'TB']:
                if size > 1024:
                    size = round(size / 1024.0, 2)
                    unit = u
        td4 = html.td('%s %s' % (size, unit), class_='size')
        tr.append(td4)
    return unicode(h)
开发者ID:mickg10,项目名称:DARLAB,代码行数:46,代码来源:html.py


示例16: findlinks_view

def findlinks_view(context, request):
    title = "%s: all package links without root/pypi" % (context.stage.name)
    projectnames = set()
    for stage, names in context.stage.op_sro("list_projectnames_perstage"):
        if stage.ixconfig["type"] == "mirror":
            continue
        projectnames.update(names)
    all_links = []
    basenames = set()
    for projectname in sorted(projectnames):
        for stage, res in context.stage.op_sro_check_pypi_whitelist(
                "get_releaselinks_perstage", projectname=projectname):
            if stage.ixconfig["type"] == "mirror":
                continue
            for link in res:
                if link.eggfragment:
                    key = link.eggfragment
                else:
                    key = link.basename
                if key not in basenames:
                    basenames.add(key)
                    all_links.append(link)
    links = []
    for link in sorted(all_links, key=attrgetter('basename')):
        href = url_for_entrypath(request, link.entrypath)
        entry = link.entry
        if entry.eggfragment:
            href += "#egg=%s" % entry.eggfragment
        elif entry.md5:
            href += "#md5=%s" % entry.md5
        links.extend([
            "/".join(link.entrypath.split("/", 2)[:2]) + " ",
            html.a(link.basename, href=href),
            html.br(), "\n"])
    if not links:
        links = [html.p('No releases.')]
    return Response(html.html(
        html.head(
            html.title(title)),
        html.body(
            html.h1(title), "\n",
            links)).unicode(indent=2))
开发者ID:msabramo,项目名称:devpi-findlinks,代码行数:42,代码来源:main.py


示例17: generate_html

    def generate_html(self):
        generated = datetime.utcnow()
        with open(os.path.join(base_path, "main.js")) as main_f:
            doc = html.html(
                self.head,
                html.body(
                    html.script(raw(main_f.read())),
                    html.p('Report generated on %s at %s' % (
                        generated.strftime('%d-%b-%Y'),
                        generated.strftime('%H:%M:%S'))),
                    html.h2('Environment'),
                    html.table(
                        [html.tr(html.td(k), html.td(v)) for k, v in sorted(self.env.items()) if v],
                        id='environment'),

                    html.h2('Summary'),
                    html.p('%i tests ran in %.1f seconds.' % (sum(self.test_count.itervalues()),
                                                              (self.suite_times["end"] -
                                                               self.suite_times["start"]) / 1000.),
                           html.br(),
                           html.span('%i passed' % self.test_count["PASS"], class_='pass'), ', ',
                           html.span('%i skipped' % self.test_count["SKIP"], class_='skip'), ', ',
                           html.span('%i failed' % self.test_count["UNEXPECTED_FAIL"], class_='fail'), ', ',
                           html.span('%i errors' % self.test_count["UNEXPECTED_ERROR"], class_='error'), '.',
                           html.br(),
                           html.span('%i expected failures' % self.test_count["EXPECTED_FAIL"],
                                     class_='expected_fail'), ', ',
                           html.span('%i unexpected passes' % self.test_count["UNEXPECTED_PASS"],
                                     class_='unexpected_pass'), '.'),
                    html.h2('Results'),
                    html.table([html.thead(
                        html.tr([
                            html.th('Result', class_='sortable', col='result'),
                            html.th('Test', class_='sortable', col='name'),
                            html.th('Duration', class_='sortable numeric', col='duration'),
                            html.th('Links')]), id='results-table-head'),
                        html.tbody(self.result_rows, id='results-table-body')], id='results-table')))

        return u"<!DOCTYPE html>\n" + doc.unicode(indent=2)
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:39,代码来源:html.py


示例18: test_class_None

def test_class_None(): 
    t = html.body(class_=None)
    u = unicode(t) 
    assert u == '<body></body>'
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:4,代码来源:test_html.py


示例19: _generate_report

    def _generate_report(self, session):
        """
        The method writes HTML report to a temporary logfile.
        """
        suite_stop_time = time.time()
        suite_time_delta = suite_stop_time - self.suite_start_time
        numtests = self.passed + self.failed + self.xpassed + self.xfailed
        generated = datetime.datetime.now()

        style_css = pkg_resources.resource_string(
            pytest_html_path, os.path.join('resources', 'style.css'))

        head = html.head(
            html.meta(charset='utf-8'),
            html.title('Test Report'),
            html.style(raw(style_css)))

        summary = [html.h2('Summary'), html.p(
            '{0} tests ran in {1:.2f} seconds.'.format(
                numtests, suite_time_delta),
            html.br(),
            html.span('{0} passed'.format(
                self.passed), class_='passed'), ', ',
            html.span('{0} skipped'.format(
                self.skipped), class_='skipped'), ', ',
            html.span('{0} failed'.format(
                self.failed), class_='failed'), ', ',
            html.span('{0} errors'.format(
                self.errors), class_='error'), '.',
            html.br(),
            html.span('{0} expected failures'.format(
                self.xfailed), class_='skipped'), ', ',
            html.span('{0} unexpected passes'.format(
                self.xpassed), class_='failed'), '.')]

        results = [html.h2('Results'), html.table([html.thead(
            html.tr([
                html.th('Result',
                        class_='sortable initial-sort result',
                        col='result'),
                html.th('Test', class_='sortable', col='name'),
                html.th('Duration',
                        class_='sortable numeric',
                        col='duration'),
                html.th('Links')]), id='results-table-head'),
            html.tbody(*self.test_logs, id='results-table-body')],
            id='results-table')]

        main_js = pkg_resources.resource_string(
            pytest_html_path, os.path.join('resources', 'main.js'))

        body = html.body(
            html.script(raw(main_js)),
            html.p('Report generated on {0} at {1}'.format(
                generated.strftime('%d-%b-%Y'),
                generated.strftime('%H:%M:%S'))))

        if session.config._environment:
            environment = set(session.config._environment)
            body.append(html.h2('Environment'))
            body.append(html.table(
                [html.tr(html.td(e[0]), html.td(e[1])) for e in sorted(
                    environment, key=lambda e: e[0]) if e[1]],
                id='environment'))

        body.extend(summary)
        body.extend(results)

        doc = html.html(head, body)

        # A string which holds the complete report.
        report_content = (
            "Test executed on commit "
            "[[https://www.github.com/tardis-sn/tardis/commit/{0}|{0}]]\n\n".format(
                tardis.__githash__
            )
        )
        report_content += doc.unicode(indent=2)

        # Quick hack for preventing log to be placed in narrow left out space
        report_content = report_content.replace(
            u'class="log"', u'class="log" style="clear: both"'
        )
        return report_content
开发者ID:rithwiksv,项目名称:tardis,代码行数:84,代码来源:report.py


示例20: pytest_sessionfinish

    def pytest_sessionfinish(self, session, exitstatus, __multicall__):
        self._make_report_dir()
        logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8')

        suite_stop_time = time.time()
        suite_time_delta = suite_stop_time - self.suite_start_time
        numtests = self.passed + self.failed + self.xpassed + self.xfailed

        server = self.config.option.sauce_labs_credentials_file and \
                 'Sauce Labs' or 'http://%s:%s' % (self.config.option.host, self.config.option.port)
        browser = self.config.option.browser_name and \
                  self.config.option.browser_version and \
                  self.config.option.platform and \
                  '%s %s on %s' % (str(self.config.option.browser_name).title(),
                                   self.config.option.browser_version,
                                   str(self.config.option.platform).title()) or \
                  self.config.option.environment or \
                  self.config.option.browser

        generated = datetime.datetime.now()
        configuration = {
            'Base URL': self.config.option.base_url,
            'Build': self.config.option.build,
            'Selenium API': self.config.option.api,
            'Driver': self.config.option.driver,
            'Firefox Path': self.config.option.firefox_path,
            'Google Chrome Path': self.config.option.chrome_path,
            'Selenium Server': server,
            'Browser': browser,
            'Timeout': self.config.option.webqatimeout,
            'Capture Network Traffic': self.config.option.capture_network,
            'Credentials': self.config.option.credentials_file,
            'Sauce Labs Credentials': self.config.option.sauce_labs_credentials_file}

        import pytest_mozwebqa
        doc = html.html(
            html.head(
                html.meta(charset='utf-8'),
                html.title('Test Report'),
                html.link(rel='stylesheet', href='style.css'),
                html.script(src='jquery.js'),
                html.script(src='main.js')),
            html.body(
                html.p('Report generated on %s at %s by pytest-mozwebqa %s' % (
                    generated.strftime('%d-%b-%Y'),
                    generated.strftime('%H:%M:%S'),
                    pytest_mozwebqa.__version__)),
                html.h2('Configuration'),
                html.table(
                    [html.tr(html.td(k), html.td(v)) for k, v in sorted(configuration.items()) if v],
                    id='configuration'),
                html.h2('Summary'),
                html.p(
                    '%i tests ran in %i seconds.' % (numtests, suite_time_delta),
                    html.br(),
                    html.span('%i passed' % self.passed, class_='passed'), ', ',
                    html.span('%i skipped' % self.skipped, class_='skipped'), ', ',
                    html.span('%i failed' % self.failed, class_='failed'), ', ',
                    html.span('%i errors' % self.errors, class_='error'), '.',
                    html.br(),
                    html.span('%i expected failures' % self.xfailed, class_='skipped'), ', ',
                    html.span('%i unexpected passes' % self.xpassed, class_='failed'), '.'),
                html.h2('Results'),
                html.table([
                    html.thead(html.tr([
                        html.th('Result', class_='sortable', col='result'),
                        html.th('Class', class_='sortable', col='class'),
                        html.th('Name', class_='sortable', col='name'),
                        html.th('Duration', class_='sortable numeric', col='duration'),
                        html.th('Links')]), id='results-table-head'),
                    html.tbody(*self.test_logs, id='results-table-body')], id='results-table')))

        logfile.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' + doc.unicode(indent=2))
        logfile.close()
开发者ID:RonnyPfannschmidt,项目名称:pytest-mozwebqa,代码行数:74,代码来源:html_report.py



注:本文中的py.xml.html.body函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python html.br函数代码示例发布时间:2022-05-25
下一篇:
Python html.a函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap