Previous topic

Builder todo list

Next topic

Actions

This Page

Building block

class soclib_builder.bblock.BBlock

A build block. This is either a input or a product of a soclib_builder.action.Action. They may be associated to a file or not, depending on Action needs.

Build blocks associated to files are indexed in a global registry, and are merged when used from different Action objects. A BBlock can tell what actions are considered user or producer of itself.

Build blocks which are products have to be passed to soclib_builder.todo.ToDo.

__init__(filename, generator = None)

Creates a new bblock, associated to a filename, and a generator.

Generator is a soclib_builder.action.Action responsible for creating the file on demand.

Parameters:
touch()

Marks the associated file as changed.

users

List of actions which are dependant from this bblock

addUser(user)

Add a given soclib_builder.action.Action object as user.

Parameters:user – a soclib_builder.action.Action
is_dir()
Returns:whether the associated path is a directory.
mtime()
Returns:the modification time of associated file
delete()

Delete the underlying file in the filesystem.

generate()

Calls the corresponding Action for building this bblock.

prepare()

Prepare the dependency list of the bblock. Must be called between the registration of users and the evaluation of dependencies.

needs(other)

Tells whether this bblock needs another one as dependency.

Parameters:other – another soclib_builder.bblock.BBlock object
Returns:True or False
class soclib_builder.bblock.AnonymousBBlock(BBlock)

A bblock that is anonymous.

__init__(generator)

Creates a new anonymous bblock associated to a generator. An anonymous bblock with no generator is irrelevant.

Parameters:generator – a soclib_builder.action.Action object.