#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#  
 | 
# @todo:   
 | 
#  
 | 
# @author: Alee  
 | 
# @date 2018-1-3 ÏÂÎç05:52:47  
 | 
# @version 1.0  
 | 
#  
 | 
# @note:   
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
import ConfigParser  
 | 
import logging  
 | 
  
 | 
class AppConfig():  
 | 
    def __init__(self, filePath, sectionName):  
 | 
        self.config = ConfigParser.ConfigParser()  
 | 
        self.config.read(filePath)  
 | 
        self.sectionName = sectionName  
 | 
          
 | 
    def SetSection(self, sectionName):  
 | 
        self.sectionName = sectionName  
 | 
          
 | 
    def GetValue(self, key):  
 | 
        return self.config.get(self.sectionName, key)   
 | 
      
 | 
    def GetIntValue(self, key):  
 | 
        return self.config.getint(self.sectionName, key)   
 | 
  
 | 
__gGameConfig = None  
 | 
  
 | 
  
 | 
          
 | 
def GetConfig():  
 | 
    global __gGameConfig  
 | 
    if not __gGameConfig:  
 | 
        FilePath = ".\Config.ini"  
 | 
        SectionName = "GeTuiConfig"  
 | 
        __gGameConfig = AppConfig (FilePath, SectionName)  
 | 
    return __gGameConfig  
 | 
  
 |