blark.plain.PlainFileLoader

class blark.plain.PlainFileLoader(filename: 'pathlib.Path', raw_source: 'str', source_type: 'SourceType' = <SourceType.general: 1>, identifier: 'Optional[str]' = None, formatted_code: 'Optional[str]' = None)[source]

Bases: object

Methods

__init__(filename, raw_source[, ...])

load(filename)

rewrite_code(identifier, code)

save(user, source_filename, parts)

save_to(path)

to_file_contents()

Attributes

formatted_code

identifier

source_type

filename

raw_source

filename: Path
raw_source: str
source_type: SourceType = 1
identifier: str | None = None
formatted_code: str | None = None
rewrite_code(identifier: str, code: str) None[source]
save_to(path: str | Path) None[source]
to_file_contents() str[source]
classmethod load(filename: Path) List[BlarkSourceItem | BlarkCompositeSourceItem][source]
static save(user: Any, source_filename: Path | None, parts: List[OutputBlock]) str[source]
__init__(filename: Path, raw_source: str, source_type: SourceType = SourceType.general, identifier: str | None = None, formatted_code: str | None = None) None