# Path: seedbox/constants.py
# INIT = 'init'
# READY = 'ready'
# ACTIVE = 'active'
# DONE = 'done'
# CANCELLED = 'cancelled'
# STATES = [INIT, READY, ACTIVE, DONE, CANCELLED]
# ACTIVE_STATES = [INIT, READY, ACTIVE]
# INACTIVE_STATES = [DONE, CANCELLED]


import logging
import xworkflows
from oslo_config import cfg
from stevedore import named
from seedbox import constants
Implements what happens during each step by binding in the provided
plugins for each and updating the db cache after each step.
"""



LOG = logging.getLogger(__name__)

cfg.CONF.import_group('process', 'seedbox.options')

WorkflowError = xworkflows.WorkflowError
AbortTransition = xworkflows.AbortTransition
InvalidTransitionError = xworkflows.InvalidTransitionError
ForbiddenTransition = xworkflows.ForbiddenTransition


class Taskflow(xworkflows.Workflow):
    """Define the workflow conditions for managing torrents;"""
    states = (
        (constants.INIT, u'Initial state'),
        (constants.READY, u'Ready'),
        (constants.ACTIVE, u'Active'),
        (constants.DONE, u'Done'),
        (constants.CANCELLED, u'Cancelled'),
    )

    transitions = (
        ('prepare', constants.INIT, constants.READY),
        ('activate', constants.READY, constants.ACTIVE),
        ('complete', constants.ACTIVE, constants.DONE),

# Path: seedbox/constants.py
# INIT = 'init'
# READY = 'ready'
# ACTIVE = 'active'
# DONE = 'done'
# CANCELLED = 'cancelled'
# STATES = [INIT, READY, ACTIVE, DONE, CANCELLED]
# ACTIVE_STATES = [INIT, READY, ACTIVE]
# INACTIVE_STATES = [DONE, CANCELLED]


# Path: seedbox/process/flow.py
import logging
import xworkflows
from oslo_config import cfg
from stevedore import named
from seedbox import constants

Implements what happens during each step by binding in the provided
plugins for each and updating the db cache after each step.
"""



LOG = logging.getLogger(__name__)

cfg.CONF.import_group('process', 'seedbox.options')

WorkflowError = xworkflows.WorkflowError
AbortTransition = xworkflows.AbortTransition
InvalidTransitionError = xworkflows.InvalidTransitionError
ForbiddenTransition = xworkflows.ForbiddenTransition


class Taskflow(xworkflows.Workflow):
    """Define the workflow conditions for managing torrents;"""
    states = (
        (constants.INIT, u'Initial state'),
        (constants.READY, u'Ready'),
        (constants.ACTIVE, u'Active'),
        (constants.DONE, u'Done'),
        (constants.CANCELLED, u'Cancelled'),
    )

    transitions = (
        ('prepare', constants.INIT, constants.READY),
        ('activate', constants.READY, constants.ACTIVE),
        ('complete', constants.ACTIVE, constants.DONE),

        ('cancel', (constants.READY, constants.ACTIVE), constants.CANCELLED),