#!/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
while repeat:
p=Process(target=doStuff args=config_profile)
p.start()
p.join()
def doStuff(config_profile):
#FIXME do a git reop check
init_queru = queruaction(config_profile)
if check_configure_guest( config_profile) is not True:
# time.sleep(60)
continue # retunr to the start of the function
else:
init_queru.procces_qureru()
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()