# -*- coding: utf-8 -*-
import ConfigParser
import json
class PartConf():
def __init__(self,env):
if env != None:
self.env = env
self.Part_Conf_List = []
self.Part_Conf = {}
self.Part_conf = ConfigParser.ConfigParser()
self.Part_conf.read("./conf/Part_conf.properties")
else:
return Exception
# 1.获取所有section为list
def Get_PartConf_List(self):
self.Part_Conf_List = self.Part_conf.options(self.env)
return self.Part_Conf_List
# 2.指定section具体值,并转换为dict
def Get_PartConf(self,Part_Name = None):
self.Part_Conf = json.loads(str(self.Part_conf.get(self.env,Part_Name)).strip())
return self.Part_Conf