Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)
Parse a DKIM Tag=Value list.

Interprets the syntax specified by RFC4871 section 3.2.
Assumes that folding whitespace is already unfolded.

@param tag_list: A string containing a DKIM Tag=Value list.

        def parse_tag_value(tag_list):
    """Parse a DKIM Tag=Value list.

    Interprets the syntax specified by RFC4871 section 3.2.
    Assumes that folding whitespace is already unfolded.

    @param tag_list: A string containing a DKIM Tag=Value list.
    """
    tags = {}
    tag_specs = tag_list.strip().split(b';')
    # Trailing semicolons are valid.
    if not tag_specs[-1]:
        tag_specs.pop()
    for tag_spec in tag_specs:
        try:
            key, value = tag_spec.split(b'=', 1)
        except ValueError:
            raise InvalidTagSpec(tag_spec)
        if key.strip() in tags:
            raise DuplicateTag(key.strip())
        tags[key.strip()] = value.strip()
    return tags
        


src/e/m/emails-0.1.12/emails/packages/dkim/__init__.py   emails(Download)
  def get_txt(s):
    raise RuntimeError("DKIM.verify requires DNS or dnspython module")
from .util import (
    get_default_logger,
    InvalidTagValueList,
    # By default, we validate the first DKIM-Signature line found.
    try:
        sig = parse_tag_value(sigheaders[idx][1])
        self.signature_fields = sig
    except InvalidTagValueList as e:
        raise KeyFormatError("missing public key: %s"%name)
    try:
        pub = parse_tag_value(s)
    except InvalidTagValueList as e:
        raise KeyFormatError(e)

src/p/y/python-emails-HEAD/emails/packages/dkim/__init__.py   python-emails(Download)
  def get_txt(s):
    raise RuntimeError("DKIM.verify requires DNS or dnspython module")
from .util import (
    get_default_logger,
    InvalidTagValueList,
    # By default, we validate the first DKIM-Signature line found.
    try:
        sig = parse_tag_value(sigheaders[idx][1])
        self.signature_fields = sig
    except InvalidTagValueList as e:
        raise KeyFormatError("missing public key: %s"%name)
    try:
        pub = parse_tag_value(s)
    except InvalidTagValueList as e:
        raise KeyFormatError(e)