.. _doot.util.dkey: ============== doot.util.dkey ============== .. py:module:: doot.util.dkey Classes ------- .. autoapisummary:: doot.util.dkey.TaskNameDKey doot.util.dkey.DootPathDKey doot.util.dkey.DootKeyed Module Contents =============== .. _doot.util.dkey.TaskNameDKey: .. py:class:: TaskNameDKey(*args: Any, **kwargs: Any) Bases: :py:obj:`jgdv.structs.dkey.DKey` A facade for DKeys and variants. Implements __new__ to create the correct key type, from a string, dynamically. kwargs: explicit = insists that keys in the string are wrapped in braces '{akey} {anotherkey}'. mark = pre-register expansion parameters / type etc check = dictate a type that expanding this key must match fparams = str formatting instructions for the key Eg: DKey('blah') -> SingleDKey('blah') -> SingleDKey('blah').format('w') -> '{blah}' -> [toml] aValue = '{blah}' Because cls.__new__ calls __init__ automatically for return values of type cls, DKey is the factory, but all DKeys are subclasses of DKeyBase, to allow control over __init__. Base class for implementing actual DKeys. init takes kwargs: fmt, mark, check, ctor, help, fallback, max_exp on class definition, can register a 'mark', 'multi', and a conversion parameter str .. _doot.util.dkey.DootPathDKey: .. py:class:: DootPathDKey(*args: Any, **kwargs: Any) Bases: :py:obj:`jgdv.structs.dkey.DKey`\ [\ :py:obj:`pathlib.Path`\ ] A MultiKey that always expands as a path, eg: `{temp}/{name}.log` .. py:attribute:: _extra_kwargs :type: ClassVar[set[str]] .. py:attribute:: _relative .. py:method:: _multi() -> Literal[True] .. py:method:: exp_extra_sources_h(current: jgdv.structs.dkey._util._interface.SourceChain_d) -> jgdv.structs.dkey._util._interface.SourceChain_d .. py:method:: exp_final_h(inst: jgdv.structs.dkey.ExpInst_d, root: jgdv.Maybe[jgdv.structs.dkey.ExpInst_d], factory: jgdv.structs.dkey._util._interface.InstructionFactory_p, opts: dict) -> jgdv.Maybe[jgdv.structs.dkey.ExpInst_d] .. _doot.util.dkey.DootKeyed: .. py:class:: DootKeyed Bases: :py:obj:`jgdv.decorators.DecoratorAccessor_m`, :py:obj:`jgdv.structs.dkey.DKeyed` Extends jgdv.structs.dkey.DKeyed to handle additional decoration types specific for doot .. py:attribute:: _decoration_builder :type: ClassVar[type] .. py:method:: taskname(fn: collections.abc.Callable) -> jgdv.Decorator :classmethod: