# 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
"""
Decorator for deploy task
"""


from __future__ import with_statement


def deploy_task(on_success=None):
	"""
	Deploy task arguments decorator
	"""

	def deploy_task_wrapper(wrapped_function):
		"""
		Deploy task decorator
		"""

		wrapped_function_name = wrapped_function.__name__

		def _pre_deploy():
			try:
				check_lock()
				lock()
				create_build_path()
				discover_latest_release()


# 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

"""
Decorator for deploy task
"""


from __future__ import with_statement


def deploy_task(on_success=None):
	"""
	Deploy task arguments decorator
	"""

	def deploy_task_wrapper(wrapped_function):
		"""
		Deploy task decorator
		"""

		wrapped_function_name = wrapped_function.__name__

		def _pre_deploy():
			try:
				check_lock()
				lock()
				create_build_path()
				discover_latest_release()


				set_state('pre_deploy', True)