scripts/support/rfam_queue_watcher.py
def start_queue(queue_name, attempts = 6):
	"""
	Starts the queue specified by queue_name
	
	queue_name: The name of the queue to start
	attempts: The number of attempts to try and start the
	queue 

	returns: True on success, False on failure
	"""

	cmd_args = ["/etc/init.d/%s" % queue_name, "start"]
	
	queue_status = check_queue_status(queue_name)

	while not queue_status:
		process = sp.Popen(cmd_args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
		response, err = process.communicate()
	
		# fetch the last element from the list
        	response_str = response.split(' ')[-1]
		
		queue_status = check_queue_status(queue_name)
		
		# exit loop if status was successful
		if attempts == 0:
			break
			
		attempts -= 1

	# reached maximum attempts and queue status is still False	
	if queue_status is False and attempts==0:
		return False
	
	return True

	Starts the queue specified by queue_name
	
	queue_name: The name of the queue to start
	attempts: The number of attempts to try and start the
	queue 

	returns: True on success, False on failure
	
Starts the queue specified by queue_name
queue_name: The name of the queue to start
attempts: The number of attempts to try and start the
queue

True on success, False on failure
Starts the queue specified by queue_name queue_name : The name of the queue to start attempts : The number of attempts to try and start the queue True on success False on failure
def start_queue(queue_name, attempts = 6):
	cmd_args = ["/etc/init.d/%s" % queue_name, "start"]
	queue_status = check_queue_status(queue_name)
	while not queue_status:
		process = sp.Popen(cmd_args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
		response, err = process.communicate()
        	response_str = response.split(' ')[-1]
		queue_status = check_queue_status(queue_name)
		if attempts == 0:
			break
		attempts -= 1
	if queue_status is False and attempts==0:
		return False
	return True
def start_queue ( queue_name , attempts = 6 ) : cmd_args = [ "/etc/init.d/%s" % queue_name , "start" ] queue_status = check_queue_status ( queue_name ) while not queue_status : process = sp . Popen ( cmd_args , stdin = sp . PIPE , stdout = sp . PIPE , stderr = sp . PIPE ) response , err = process . communicate ( ) response_str = response . split ( ' ' ) [ - 1 ] queue_status = check_queue_status ( queue_name ) if attempts == 0 : break attempts -= 1 if queue_status is False and attempts == 0 : return False return True
Starts the queue specified by queue_name
queue_name: The name of the queue to start
attempts: The number of attempts to try and start the
queue
Starts the queue specified by queue_name queue_name : The name of the queue to start attempts : The number of attempts to try and start the queue
"""
	Starts the queue specified by queue_name
	
	queue_name: The name of the queue to start
	attempts: The number of attempts to try and start the
	queue 

	returns: True on success, False on failure
	""" # fetch the last element from the list # exit loop if status was successful # reached maximum attempts and queue status is still False	
queue_name
attempts