2013-05-02 19:13:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Task(object):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""The task class represents are task that can be run.
|
|
|
|
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
|
|
|
"""
|
|
|
|
Returns:
|
|
|
|
string.
|
|
|
|
"""
|
2014-01-05 15:57:11 +01:00
|
|
|
return '{module}.{task}'.format(module=cls.__module__, task=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
|
|
|
"""
|
|
|
|
Returns:
|
|
|
|
string.
|
|
|
|
"""
|
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
|
|
|
|
Args:
|
|
|
|
info (BootstrapInformation): The bootstrap info object
|
|
|
|
"""
|
2014-01-05 15:57:11 +01:00
|
|
|
pass
|