예제 #1
0
파일: GitFSBase.py 프로젝트: imclab/GitFS
 def getMTab(self, lock=True):
     cf = ConfigFile()
     if lock:
         self.lockGitFSDir()
     try:
         cf.readFile(self.getMTabFileName())
     except IOError:
         pass
     finally:
         if lock:
             self.unlockGitFSDir()
     logging.debug('read configuration: %s\n' %cf.getConfig())
     return cf.getConfig()
예제 #2
0
파일: GitFSBase.py 프로젝트: imclab/GitFS
 def getConfig(self, name):
     if self.config is not None and name in self.config:
         return self.config[name]
     cf = ConfigFile()
     files = []
     f = self.getConfigFileName(name)
     logging.debug('getConfig filename for %s is %s' %(name, f))
     if f is None:
         return None
     files.append(f)
     if name == 'gitfsdir':
         self.lockGitFSDir()
     try:
         cf.readFile(files)
     except IOError:
         # ignore files that don't exist and the like.
         pass
     finally:
         if name == 'gitfsdir':
             self.unlockGitFSDir()
     self.config = cf.getConfig()
     return self.config