Source File

class dffml.source.file.BinaryFileSource(config)[source]
CONFIG

alias of BinaryFileSourceConfig

class dffml.source.file.BinaryFileSourceConfig(filename: str, tag: str = 'untagged', readwrite: bool = False, allowempty: bool = False)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
class dffml.source.file.FileSource(config)[source]

FileSource reads and write from a file on open / close.

CONFIG

alias of FileSourceConfig

class dffml.source.file.FileSourceConfig(filename: str, tag: str = 'untagged', readwrite: bool = False, allowempty: bool = False)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1