# Path: py_mina/state.py
# def set(key, value):
# 
# Path: py_mina/echo.py
# def echo_task(message, error=False):
#     color = red if error == True else yellow
#     
#     print(color('\n=====> %s' % message))


import timeit
from fabric.api import task, settings
from py_mina.state import state, set_state
from py_mina.subtasks.deploy import *
from py_mina.echo import echo_task


		def _post_deploy():
			if state.get('deploy') == True:
				try:
					move_build_to_releases()
					link_release_to_current()

					set_state('post_deploy', True)
				except Exception as error: 
					set_state('post_deploy', error)

					raise error # escalate exception to 'deploy_wrapper' function


		def _finalize_deploy():
			if not state.get('success') == True:
				echo_task('Cleaning up failed deploy')

			try:
				cleanup_releases()
				remove_build_path()
				force_unlock()

				set_state('finalize', True)
			except Exception as error:
				set_state('finalize', error)


		def _on_success_deploy():

# Path: py_mina/state.py
# def set(key, value):
# 
# Path: py_mina/echo.py
# def echo_task(message, error=False):
#     color = red if error == True else yellow
#     
#     print(color('\n=====> %s' % message))


# Path: py_mina/decorators/deploy.py
import timeit
from fabric.api import task, settings
from py_mina.state import state, set_state
from py_mina.subtasks.deploy import *
from py_mina.echo import echo_task



		def _post_deploy():
			if state.get('deploy') == True:
				try:
					move_build_to_releases()
					link_release_to_current()

					set_state('post_deploy', True)
				except Exception as error: 
					set_state('post_deploy', error)

					raise error # escalate exception to 'deploy_wrapper' function


		def _finalize_deploy():
			if not state.get('success') == True:
				echo_task('Cleaning up failed deploy')

			try:
				cleanup_releases()
				remove_build_path()
				force_unlock()

				set_state('finalize', True)
			except Exception as error:
				set_state('finalize', error)


		def _on_success_deploy():

			if  state.get('success') == True and callable(on_success):