1#!/usr/bin/env python3
2"""
3
4
5"""
6# Imports:
7from __future__ import annotations
8
9# ##-- stdlib imports
10import datetime
11import enum
12import functools as ftz
13import itertools as itz
14import logging as logmod
15import pathlib as pl
16import re
17import time
18import types
19import collections
20import contextlib
21import hashlib
22from copy import deepcopy
23from uuid import UUID, uuid1
24from weakref import ref
25import atexit # for @atexit.register
26import faulthandler
27# ##-- end stdlib imports
28
29from bibble.util.middlecore import IdenLibraryMiddleware
30from bibble.model import MetaBlock
31
32# ##-- types
33# isort: off
34import abc
35import collections.abc
36from typing import TYPE_CHECKING, cast, assert_type, assert_never
37from typing import Generic, NewType, Never
38# Protocols:
39from typing import Protocol, runtime_checkable
40# Typing Decorators:
41from typing import no_type_check, final, override, overload
42# from dataclasses import InitVar, dataclass, field
43# from pydantic import BaseModel, Field, model_validator, field_validator, ValidationError
44
45if TYPE_CHECKING:
46 from jgdv import Maybe
47 from typing import Final
48 from typing import ClassVar, Any, LiteralString
49 from typing import Self, Literal
50 from typing import TypeGuard
51 from collections.abc import Iterable, Iterator, Callable, Generator
52 from collections.abc import Sequence, Mapping, MutableMapping, Hashable
53
54##--|
55
56# isort: on
57# ##-- end types
58
59##-- logging
60logging = logmod.getLogger(__name__)
61##-- end logging
62
63# Vars:
64
65# Body:
66
[docs]
67class DataInsertMW(IdenLibraryMiddleware):
68 """
69 Inserts kwargs data into the metablock
70 """
71
72 def __init__(self, *args, **kwargs):
73 super().__init__(*args)
74 self._data = dict(kwargs)
75
[docs]
76 def update(self, data:dict) -> None:
77 self._data.update(data)
78