extract_msg.msg_classes.task_request Module

Module contents

class extract_msg.msg_classes.task_request.TaskRequest(path, **kwargs)[source]

Bases: MessageBase

Class for handling Task Request objects, including Task Accept, Task Decline, and Task Update.

Supports all of the options from MSGFile.__init__() with some additional ones.

Parameters:
  • recipientSeparator – Optional, separator string to use between recipients.

  • deencapsulationFunc – Optional, if specified must be a callable that will override the way that HTML/text is deencapsulated from the RTF body. This function must take exactly 2 arguments, the first being the RTF body from the message and the second being an instance of the enum DeencapType that will tell the function what type of body is desired. The function should return a string for plain text and bytes for HTML. If any problems occur, the function must either return None or raise one of the appropriate exceptions from extract_msg.exceptions. All other exceptions must be handled internally or they will not be caught. The original deencapsulation method will not run if this is set.

property headerFormatProperties: Dict[str, str | Tuple[str | None, bool] | None | Dict[str, str | Tuple[str | None, bool] | None]] | None

Returns a dictionary of properties, in order, to be formatted into the header.

Keys are the names to use in the header while the values are one of the following:

  • None: Signifies no data was found for the property and it should be omitted from the header.

  • str: A string to be formatted into the header using the string encoding.

  • Tuple[Union[str, None], bool]: A string should be formatted into the header. If the bool is True, then place an empty string if the first value is None, otherwise follow the same behavior as regular None.

Additional note: If the value is an empty string, it will be dropped as well by default.

Additionally you can group members of a header together by placing them in an embedded dictionary. Groups will be spaced out using a second instance of the join string. If any member of a group is being printed, it will be spaced apart from the next group/item.

If you class should not do any header injection, return None from this property.

property processed: bool

Indicates whether a client has already processed a received task communication.

property taskMode: TaskMode | None

The assignment status of the embedded Task object.

property taskObject: Task | None

The task object embedded in this Task Request object.

This function does all of the most basic validation, and so will log most issues or throw exceptions if there are too many problems.

Raises:

StandardViolationError – A standard was blatently violated in a way that program does not tolerate.

property taskRequestType: TaskRequestType | None

The type of task request.

filename: str | None