stuffer.content module

Ways to supply (string) content for Actions that create or manipulate files.

class stuffer.content.DeferStr(supplier)[source]

Bases: object

Lazy string, making a string supplier appear as a string.

It is possible to create Actions that provide information at runtime, e.g. an installation path or a version number. DeferStr can be used to encapsulate such an Action method, and make it appear as a plain string, in order to pass it as argument to another Action. It will then be evaluated lazily, at runtime.

class stuffer.content.OutputOf(command)[source]

Bases: object

Supply the output of a command, executed inside the container.

command
Command to execute. If it is a string, it will be interpreted by the shell.
stuffer.content.supplier(contents: Union[str, stuffer.content.DeferStr, Callable[str]]) → Callable[str][source]

Convert an argument to a string supplier, if it is not already.