IPWorks OpenPGP 2020 Python Edition

Questions / Feedback?

on_header Event

Fired every time a header is parsed.


class MIMEHeaderEventParams(object):
  def part_index() -> int: ...
  def field() -> str: ...
  def value() -> bytes: ...

# In class MIME:
def on_header() -> Callable[[MIMEHeaderEventParams], None]: ...
def on_header(event_hook: Callable[[MIMEHeaderEventParams], None]) -> None: ...


The PartIndex parameter contains the index of the part containing the current header. If the header is from the MIME body, this value will be -1. The Field parameter contains the name of the MIME header. The Value parameter contains the header contents. The on_header event is fired when a header is parsed, which occurs for each header of the Message when decode_from_file, decode_from_string, or decode_from_stream is called.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks OpenPGP 2020 Python Edition - Version 20.0 [Build 8161]