class serviceMana(object):

    def __init__(self,location = '/serviceMana/WEB-INF/classes/'):
        self.location = location
        self.user_input = User_Input()
        self.user_input.input_user()
        self.user_input.input_cas_config()
        self.user_input.input_db_config()
        self.user_input.input_project_config()
        self.user_input.input_ip_port_config()

    # jeesite.properties
    def je_properties(self):
        old_str = 'jeesite.properties'
        location_str = self.user_input.location
        find_list = ['cas.server.url','cas.project.url','jdbc.url']

        for find_str in find_list:
            if self.user_input.config.get(find_str):
                if find_str == 'cas.project.url':
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str] + 'serviceMana').Globa_Edit()
                else:
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str]).Globa_Edit()

    # systemUrl.properties
    def sy_properties(self):
        old_str = 'systemUrl.properties'
        location_str = self.user_input.location

        Edit_Congif(location_str+self.location+old_str,
                    new_str=self.user_input.ip_port).Re_Edit()
class acb(object):

    def __init__(self,location = '/acb/WEB-INF/classes/'):
        self.location = location
        self.user_input = User_Input()
        self.user_input.input_user()
        self.user_input.input_cas_config()
        self.user_input.input_db_config()
        self.user_input.input_project_config()
        self.user_input.input_ip_port_config()
        self.user_input.input_bpm_config()
        self.user_input.input_superMap_config()
        self.user_input.input_redis_config()

    # jeesite.properties
    def je_properties(self):
        old_str = 'jeesite.properties'
        location_str = self.user_input.location
        find_list = ['cas.server.url','cas.project.url','jdbc.url']

        for find_str in find_list:
            if self.user_input.config.get(find_str):
                if find_str == 'cas.project.url':
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str] + 'acb').Globa_Edit()
                else:
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str]).Globa_Edit()

    # raqreport.properties
    def ra_properties(self):
        old_str = 'acbReport.properties'
        location_str = self.user_input.location

        Edit_Congif(location_str+self.location+old_str,
                    new_str=self.user_input.ip_port).Re_Edit()

    # systemUrl.properties
    def sy_properties(self):
        old_str = 'systemUrl.properties'
        location_str = self.user_input.location

        Edit_Congif(location_str+self.location+old_str,
                    new_str=self.user_input.ip_port).Re_Edit()

        find_list = ['bpmUrl','superMapUrl']
        for find_str in find_list:
            if self.user_input.acb_config.get(find_str):
                Edit_Congif(location_str+self.location+old_str,find_str,
                            self.user_input.acb_config[find_str]).Globa_Edit()

    def redis_conf(self):
        old_str = 'spring-context-jedis.xml'
        location_str = self.user_input.location
        find_str = 'bean'

        Edit_Congif(location_str + self.location + old_str, find_str,
                    self.user_input.redis).Xml_Redis2()
class uams(object):

    def __init__(self,location = '/uams/WEB-INF/classes/'):
        self.location = location
        self.user_input = User_Input()
        self.user_input.input_user()
        self.user_input.input_cas_config()
        self.user_input.input_db_config()
        self.user_input.input_project_config()
        self.user_input.input_ip_port_config()
        self.user_input.input_bpm_config()
        self.user_input.input_continuedDevbpmUrl_config()
        self.user_input.input_modernAgriDemobpmUrl_config()
        self.user_input.input_modernAgriIndusParkbpmUrl_config()

    # jeesite.properties
    def je_properties(self):
        old_str = 'jeesite.properties'
        location_str = self.user_input.location
        find_list = ['cas.server.url','cas.project.url','jdbc.url']

        for find_str in find_list:
            if self.user_input.config.get(find_str):
                if find_str == 'cas.project.url':
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str] + 'uams').Globa_Edit()
                else:
                    Edit_Congif(location_str + self.location + old_str, find_str,
                                self.user_input.config[find_str]).Globa_Edit()

    # systemUrl.properties
    def sy_properties(self):
        old_str = 'systemUrl.properties'
        location_str = self.user_input.location

        Edit_Congif(location_str+self.location+old_str,
                    new_str=self.user_input.ip_port).Re_Edit()

        find_list = ['bpmUrl', 'modernAgriDemobpmUrl', 'continuedDevbpmUrl', 'modernAgriIndusParkbpmUrl']
        for find_str in find_list:
            if self.user_input.uams_config.get(find_str):
                Edit_Congif(location_str + self.location + old_str, find_str,
                            self.user_input.uams_config[find_str]).Globa_Edit()