• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

collective / sphinxcontrib-httpexample / a43cb023e0d04fe59852315c1ffb8a25dd1ff96e

17 Aug 2024 05:41PM UTC coverage: 96.629% (+2.7%) from 93.933%
a43cb023e0d04fe59852315c1ffb8a25dd1ff96e

push

github

datakurre
Back to development: 1.3

430 of 445 relevant lines covered (96.63%)

1.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.65
/src/sphinxcontrib/httpexample/__init__.py
1
# -*- coding: utf-8 -*-
2
from sphinxcontrib.httpexample.directives import HTTPExample
2✔
3

4
import os
2✔
5
import pkg_resources
2✔
6
import shutil
2✔
7

8

9
CSS_FILE = 'sphinxcontrib-httpexample.css'
2✔
10
JS_FILE = 'sphinxcontrib-httpexample.js'
2✔
11

12

13
def copy_assets(app, exception):
2✔
14
    if app.builder.name != 'html' or exception:
2✔
15
        return
×
16

17
    # CSS
18
    src = os.path.join(os.path.dirname(__file__), 'static', CSS_FILE)
2✔
19
    dst = os.path.join(app.builder.outdir, '_static', CSS_FILE)
2✔
20
    shutil.copyfile(src, dst)
2✔
21

22
    # JS
23
    src = os.path.join(os.path.dirname(__file__), 'static', JS_FILE)
2✔
24
    dst = os.path.join(app.builder.outdir, '_static', JS_FILE)
2✔
25
    shutil.copyfile(src, dst)
2✔
26

27

28
def setup(app):
2✔
29
    app.connect('build-finished', copy_assets)
2✔
30
    app.add_directive_to_domain('http', 'example', HTTPExample)
2✔
31
    app.add_js_file(JS_FILE)
2✔
32
    app.add_css_file(CSS_FILE)
2✔
33
    app.add_config_value('httpexample_scheme', 'http', 'html')
2✔
34
    dist = pkg_resources.get_distribution('sphinxcontrib-httpexample')
2✔
35
    return {'version': dist.version}
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc