All pastes #2093194 Raw Edit

Unnamed

public text v1 · immutable
#2093194 ·published 2011-11-08 22:09 UTC
rendered paste body
#!/usr/bin/python

# Get the options from the config file set in gobs.readconf
from gobs.readconf import get_conf_settings
reader=get_conf_settings()
gobs_settings_dict=reader.read_gobs_settings_all()
# make a CM
from gobs.ConnectionManager import connectionManager
CM=connectionManager(gobs_settings_dict)
#selectively import the pgsql/mysql querys
if CM.getName()=='pgsql':
  from gobs.pgsql import *

from gobs.check_setup import check_configure_guest
from gobs.build_queru import queruaction
import portage
import sys
import os
from multiprocessing import Process

def main_loop(config_profile):
	repeat = True
	#get a connection from the pool
	init_queru = queruaction(config_profile)
	while repeat:
		#FIXME do a git reop check
		if check_configure_guest( config_profile) is not True:
			# time.sleep(60)
			continue		# retunr to the start of the function
		else:
		  p = Process(target=init_queru.procces_qureru)
		  p.start()
		  p.join()
def main():
  # Main
  config_profile = gobs_settings_dict['gobs_config']
  #we provide the main_loop with the ConnectionManager so we can hand out connections from within the loop
  main_loop(config_profile)
  connectionManager.closeAllConnections()

if __name__ == "__main__":
  main()