From 828d5064f1e51b107c53da79c97caa186099ac91 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Mon, 5 Oct 2026 19:55:52 -0400 Subject: [PATCH] docs: close the #719 sweep's last three leftovers (#719) --- docs/source/pcapkit/foundation/registry.rst | 2 ++ pcapkit/foundation/registry/protocols.py | 5 ++--- pcapkit/toolkit/dpkt.py | 8 ++++---- pcapkit/toolkit/pcap.py | 8 ++++---- pcapkit/toolkit/pcap_ct.py | 5 +---- pcapkit/toolkit/pcapng.py | 12 ++++++------ pcapkit/toolkit/pypcap.py | 5 +---- pcapkit/toolkit/pypcapfile.py | 8 ++++---- pcapkit/toolkit/pyshark.py | 8 ++++---- pcapkit/toolkit/scapy.py | 8 ++++---- pcapkit/utilities/logging.py | 4 ++-- 11 files changed, 34 insertions(+), 39 deletions(-) diff --git a/docs/source/pcapkit/foundation/registry.rst b/docs/source/pcapkit/foundation/registry.rst index ed9b479b34..334b4a27e9 100644 --- a/docs/source/pcapkit/foundation/registry.rst +++ b/docs/source/pcapkit/foundation/registry.rst @@ -55,6 +55,8 @@ Protocol Registries .. autofunction:: pcapkit.foundation.registry.protocols.register_protocol +.. autofunction:: pcapkit.foundation.registry.protocols.register_protocol_code + Top-Level Registries ~~~~~~~~~~~~~~~~~~~~ diff --git a/pcapkit/foundation/registry/protocols.py b/pcapkit/foundation/registry/protocols.py index f0c45eb0dd..f218d7d22e 100644 --- a/pcapkit/foundation/registry/protocols.py +++ b/pcapkit/foundation/registry/protocols.py @@ -302,9 +302,8 @@ def register_protocol_code(protocol: 'Type[ProtocolBase]', code: 'Any') -> 'None r"""Register ``protocol`` into the next-layer dispatch registry (or registries) named by ``code``. - This is what backs the ``code`` keyword of - :meth:`ProtocolBase.__init_subclass__ - `; it can also + This is what backs the ``code`` class keyword of + :class:`~pcapkit.protocols.protocol.ProtocolBase` subclasses; it can also be called directly to register a class that declined at class-definition time. diff --git a/pcapkit/toolkit/dpkt.py b/pcapkit/toolkit/dpkt.py index 8faa3358f1..074c3b2ecd 100644 --- a/pcapkit/toolkit/dpkt.py +++ b/pcapkit/toolkit/dpkt.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.dpkt -:mod:`pcapkit.toolkit.dpkt` contains all you need for -:mod:`pcapkit` handy usage with `DPKT`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.dpkt` contains the adapters for the `DPKT`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _DPKT: https://dpkt.readthedocs.io diff --git a/pcapkit/toolkit/pcap.py b/pcapkit/toolkit/pcap.py index 828aced385..242d91c443 100644 --- a/pcapkit/toolkit/pcap.py +++ b/pcapkit/toolkit/pcap.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.pcap -:mod:`pcapkit.toolkit.pcap` contains all you need for -:mod:`pcapkit` handy usage of PCAP file format. All -functions returns with a flag to indicate if usable -for its caller. +:mod:`pcapkit.toolkit.pcap` contains the adapters for the PCAP format. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. """ from typing import TYPE_CHECKING, cast diff --git a/pcapkit/toolkit/pcap_ct.py b/pcapkit/toolkit/pcap_ct.py index 23ac454a2e..4c0895da5a 100644 --- a/pcapkit/toolkit/pcap_ct.py +++ b/pcapkit/toolkit/pcap_ct.py @@ -4,10 +4,7 @@ .. module:: pcapkit.toolkit.pcap_ct -:mod:`pcapkit.toolkit.pcap_ct` contains all you need for -:mod:`pcapkit` handy usage with `pcap-ct`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pcap_ct` contains the adapters for the `pcap-ct`_ engine. .. _pcap-ct: https://pypi.org/project/pcap-ct/ diff --git a/pcapkit/toolkit/pcapng.py b/pcapkit/toolkit/pcapng.py index 1bbfa75036..9b654a93b1 100644 --- a/pcapkit/toolkit/pcapng.py +++ b/pcapkit/toolkit/pcapng.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -"""PCAP-NG-NG Tools -=================== +"""PCAP-NG Tools +============= .. module:: pcapkit.toolkit.pcapng -:mod:`pcapkit.toolkit.pcapng` contains all you need -for :mod:`pcapkit` handy usage of PCAP-NG-NG file format. -All functions returns with a flag to indicate if -usable for its caller. +:mod:`pcapkit.toolkit.pcapng` contains the adapters for the PCAP-NG format. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. """ from typing import TYPE_CHECKING, cast diff --git a/pcapkit/toolkit/pypcap.py b/pcapkit/toolkit/pypcap.py index e81673806f..6a26c0fa31 100644 --- a/pcapkit/toolkit/pypcap.py +++ b/pcapkit/toolkit/pypcap.py @@ -4,10 +4,7 @@ .. module:: pcapkit.toolkit.pypcap -:mod:`pcapkit.toolkit.pypcap` contains all you need for -:mod:`pcapkit` handy usage with `PyPCAP`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pypcap` contains the adapters for the `PyPCAP`_ engine. .. _PyPCAP: https://github.com/pynetwork/pypcap diff --git a/pcapkit/toolkit/pypcapfile.py b/pcapkit/toolkit/pypcapfile.py index 64a5f64cd7..cf39236acc 100644 --- a/pcapkit/toolkit/pypcapfile.py +++ b/pcapkit/toolkit/pypcapfile.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.pypcapfile -:mod:`pcapkit.toolkit.pypcapfile` contains all you need for -:mod:`pcapkit` handy usage with `PyPCAPFile`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pypcapfile` contains the adapters for the `PyPCAPFile`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _PyPCAPFile: https://github.com/kisom/pypcapfile diff --git a/pcapkit/toolkit/pyshark.py b/pcapkit/toolkit/pyshark.py index 61922a97bd..27481c2602 100644 --- a/pcapkit/toolkit/pyshark.py +++ b/pcapkit/toolkit/pyshark.py @@ -2,10 +2,10 @@ """PyShark Tools =================== -:mod:`pcapkit.toolkit.pyshark` contains all you need for -:mod:`pcapkit` handy usage with `PyShark`_ engine. All -reforming functions returns with a flag to indicate if -usable for its caller. +:mod:`pcapkit.toolkit.pyshark` contains the adapters for the `PyShark`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _PyShark: https://kiminewt.github.io/pyshark diff --git a/pcapkit/toolkit/scapy.py b/pcapkit/toolkit/scapy.py index 3164ba7175..517d577426 100644 --- a/pcapkit/toolkit/scapy.py +++ b/pcapkit/toolkit/scapy.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.scapy -:mod:`pcapkit.toolkit.scapy` contains all you need for -:mod:`pcapkit` handy usage with `Scapy`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.scapy` contains the adapters for the `Scapy`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _Scapy: https://scapy.net diff --git a/pcapkit/utilities/logging.py b/pcapkit/utilities/logging.py index ac8bcb473b..517668d200 100644 --- a/pcapkit/utilities/logging.py +++ b/pcapkit/utilities/logging.py @@ -96,7 +96,7 @@ #: logging.StreamHandler: The historical :obj:`sys.stderr` handler. It is only #: *attached* under :envvar:`PCAPKIT_DEVMODE`; it is constructed unconditionally #: so that ``logger.addHandler(handler)`` remains a one-line way back to the -#: pre-1.4 default output. +#: pre-1.5 default output. handler = logging.StreamHandler(sys.stderr) handler.setFormatter(formatter) @@ -287,7 +287,7 @@ def configure(level: 'Optional[Union[int, str]]' = None, *, one is meant to receive ``fmt`` would be ambiguous. Example: - Restore the pre-1.4 default of :obj:`sys.stderr` at + Restore the pre-1.5 default of :obj:`sys.stderr` at :data:`logging.INFO`:: configure(logging.INFO, stream=sys.stderr)