fabricius.plugins package#

Submodules#

fabricius.plugins.generator module#

class fabricius.plugins.generator.GeneratorPlugin#

Bases: BasePlugin

A plugin to plug to the fabricius.generator.generator.Generator class.

You can edit the methods of the class, and they’ll be run according to their description.

on_file_add(file: FileGenerator) Any#

Called when a new file has been added to the generator.

Parameters:

file (fabricius.generator.file.FileGenerator) – The file that has been added to the generator.

before_execution() Any#

Called when the user has called the “execute” method. This is ran before the generator creates any files.

before_file_commit(file: FileGenerator) Any#

Called when a file is about to be created. The file is NOT yet created and is still not saved locally.

Parameters:

file (fabricius.generator.file.FileGenerator) – The file that will be generated.

after_file_commit(file: FileGenerator) Any#

Called when a file has been created and saved locally.

Parameters:

file (fabricius.generator.file.FileGenerator) – The file that has been generated.

after_execution(results: Dict[FileGenerator, Optional[GeneratorCommitResult]]) Any#

Called when the generator has realized all file generation.

Parameters:

results (List of fabricius.generator.file.GeneratorCommitResult) – A list of GeneratorCommitResult.

on_commit_fail(file: FileGenerator, exception: Exception) Any#

Called when the generator has failed to commit a file.

Parameters:

Module contents#