File: module.html.jinja2

package info (click to toggle)
mitmproxy 8.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 38,952 kB
  • sloc: python: 53,389; javascript: 1,603; xml: 186; sh: 105; ansic: 68; makefile: 13
file content (75 lines) | stat: -rw-r--r-- 3,321 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{% extends "default/module.html.jinja2" %}
{#
To document all event hooks, we do a bit of hackery:
  1. scripts/api-events.py auto-generates generated/events.py.
  2. scripts/api-render.py renders generated/events.py together with the remaining API docs.
  3. This templates hides some elements of the default pdoc template.

#}
{% if module.name == "events" %}
    {% macro module_name() %}{% endmacro %}
    {% macro class(cls) %}
        <span class="name">{{ cls.qualname.replace("Events", " Events").replace("AdvancedLifecycle", "Advanced Lifecycle") }}</span>
    {% endmacro %}
    {% macro view_source_state(doc) %}{% endmacro %}
    {% macro view_source_button(doc) %}{% endmacro %}
    {% macro view_source_code(doc) %}{% endmacro %}
    {% macro is_public(doc) %}
        {% if doc.name != "__init__" %}
            {{ default_is_public(doc) }}
        {% endif %}
    {% endmacro %}
{% else %}
    {% macro is_public(doc) %}
        {% if doc.name is in(["from_state", "get_state", "set_state"]) %}
        {% elif doc.modulename == "mitmproxy.addonmanager" %}
            {% if doc.qualname.startswith("Loader") and not doc.name.startswith("_") %}
                true
            {% endif %}
        {% elif doc.modulename == "mitmproxy.certs" %}
            {% if doc.qualname == "Cert" or doc.qualname.startswith("Cert.") %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.coretypes.multidict" %}
            {% if doc.name == "_MultiDict" %}
                true
            {% else %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.dns" %}
            {% if doc.qualname.startswith("DNSFlow") %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.flow" %}
            {% if doc.name is not in(["__init__", "reply", "metadata"]) %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.http" %}
            {% if doc.qualname is not in([
                    "Message.__init__", "Message.data",
                    "Request.data",
                    "Response.data",
                    ]) %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.proxy.server_hooks" %}
            {% if doc.qualname.startswith("ServerConnectionHookData") and doc.name != "__init__" %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.proxy.context" %}
            {% if doc.qualname is not in(["Context.__init__", "Context.fork", "Context.options"]) %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.tls" %}
            {% if doc.qualname is not in(["TlsData.__init__", "ClientHelloData.__init__"]) %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% elif doc.modulename == "mitmproxy.websocket" %}
            {% if doc.qualname != "WebSocketMessage.type" %}
                {{ default_is_public(doc) }}
            {% endif %}
        {% else %}
            {{ default_is_public(doc) }}
        {% endif %}
    {% endmacro %}
{% endif %}