#NEWLINE# @ register_bounce_method ( 'downthenup' ) #NEWLINE# def downthenup_bounce( new_config , new_app_running , happy_new_tasks , old_app_live_happy_tasks , old_app_live_unhappy_tasks ) : #NEWLINE# #INDENT# 'Stops any old apps and waits for them to die before starting a new one.\n\n    See the docstring for brutal_bounce() for parameters and return value.\n    ' #NEWLINE# return { #NEWLINE# #INDENT# 'create_app' : ( ( not old_app_live_happy_tasks ) and ( not new_app_running ) ) , #NEWLINE# 'tasks_to_drain' : ( flatten_tasks ( old_app_live_happy_tasks ) | flatten_tasks ( old_app_live_unhappy_tasks ) ) , #NEWLINE# #UNINDENT# }