Exemplo n.º 1
0
 def __init__(self,fullfilepath):
     self._filepath=fullfilepath
     if not os.path.isdir(os.path.dirname(fullfilepath)):
         os.makedirs(os.path.dirname(fullfilepath))
     self._conf=ConfigParser.ConfigParser()
     if os.path.isfile(fullfilepath):
         try:
             self._conf.readfp(open(fullfilepath,"r"))
         except Exception,e:
             PLOG.error("配置文件'%s'打开失败,err=%s"%(self._filepath,e))
Exemplo n.º 2
0
 def __init__(self, fullfilepath):
     self._filepath = fullfilepath
     if not os.path.isdir(os.path.dirname(fullfilepath)):
         os.makedirs(os.path.dirname(fullfilepath))
     self._conf = ConfigParser.ConfigParser()
     if os.path.isfile(fullfilepath):
         try:
             self._conf.readfp(open(fullfilepath, "r"))
         except Exception, e:
             PLOG.error("配置文件'%s'打开失败,err=%s" % (self._filepath, e))
Exemplo n.º 3
0
 def save(self):
     try:
         self._conf.write(open(self._filepath,"w"))
     except Exception,e:
         PLOG.error("配置文件'%s'保存失败,err=%s"%(self._filepath,e))
Exemplo n.º 4
0
 def save(self):
     try:
         self._conf.write(open(self._filepath, "w"))
     except Exception, e:
         PLOG.error("配置文件'%s'保存失败,err=%s" % (self._filepath, e))