2013-05-02 19:13:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Task(object):
|
2014-03-23 19:37:25 +01:00
|
|
|
"""The task class represents a task that can be run.
|
2014-03-23 16:04:03 +01:00
|
|
|
It is merely a wrapper for the run function and should never be instantiated.
|
|
|
|
"""
|
|
|
|
# The phase this task is located in.
|
2013-06-23 15:26:08 +02:00
|
|
|
phase = None
|
2014-03-23 16:04:03 +01:00
|
|
|
# List of tasks that should run before this task is run
|
2013-11-21 15:54:42 +01:00
|
|
|
predecessors = []
|
2014-03-23 16:04:03 +01:00
|
|
|
# List of tasks that should run after this task has run
|
2013-11-21 15:54:42 +01:00
|
|
|
successors = []
|
2013-05-02 19:13:35 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
class __metaclass__(type):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""Metaclass to control how the class is coerced into a string
|
|
|
|
"""
|
2014-01-05 15:57:11 +01:00
|
|
|
def __repr__(cls):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-05-04 19:31:53 +02:00
|
|
|
:return str: The full module path to the Task
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-05-03 22:24:13 +02:00
|
|
|
return cls.__module__ + '.' + cls.__name__
|
2013-06-23 15:26:08 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
def __str__(cls):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-05-04 19:31:53 +02:00
|
|
|
:return: The full module path to the Task
|
|
|
|
:rtype: str
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-01-05 15:57:11 +01:00
|
|
|
return repr(cls)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""The run function, all work is done inside this function
|
2014-03-23 19:37:25 +01:00
|
|
|
|
2014-05-04 19:31:53 +02:00
|
|
|
:param BootstrapInformation info: The bootstrap info object.
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-01-05 15:57:11 +01:00
|
|
|
pass
|