4.1 Tasks¶
4.1.1 Task¶
-
class
baelfire.task.Task(core=None)¶ Normal task.
-
build_if(dependency)¶ Add dependency to a task.
-
name¶ Return name of this task.
-
run()¶ Check all dependencies and rebuild if needed.
-
run_before(task)¶ Run task before self.
-
save_report()¶ Save report file after task run.
-
touch(file_name=None, file_path=None, times=None)¶ Update mtime of a file.
- file_name - name of the file in Core.paths
- file_path - path to a file
- times - set the access and modified times of the file specified by path (see os.utime documentation)
-
4.1.2 TemplateTask¶
-
class
baelfire.task.template.TemplateTask(core=None)¶ Task which generate file from template.
4.1.3 FileTask¶
-
class
baelfire.task.file.FileTask(core=None)¶ Task which operates on files.
Need to implement
FileTask.output_nameparameter.
4.1.4 SubprocessTask¶
4.1.5 ScreenTask¶
-
class
baelfire.task.screen.ScreenTask(core=None)¶ Start command in detached screen. In order to use ScreenTask, your application’s core needs to inherit from ScreenCore.
4.1.6 AttachScreenTask¶
-
class
baelfire.task.screen.AttachScreenTask(core=None)¶ Attach task from screen. Run it first if needed.
In order to use AttachScreenTask, your application’s core needs to inherit from ScreenCore and you need to set detached_task property, which should be the ScreenTask like task.