예제 #1
0
 def matches_filename(self, config_filename, glob):
     """Return True if section glob matches filename"""
     config_dirname = normpath(dirname(config_filename)).replace(sep, '/')
     glob = glob.replace("\\#", "#")
     glob = glob.replace("\\;", ";")
     if '/' in glob:
         if glob.find('/') == 0:
             glob = glob[1:]
         glob = posixpath.join(config_dirname, glob)
     else:
         glob = posixpath.join('**/', glob)
     return fnmatch(self.filename, glob)
예제 #2
0
파일: ini.py 프로젝트: yuan-hp/vim
 def matches_filename(self, config_filename, glob):
     """Return True if section glob matches filename"""
     config_dirname = normpath(dirname(config_filename)).replace(sep, '/')
     glob = glob.replace("\\#", "#")
     glob = glob.replace("\\;", ";")
     if '/' in glob:
         if glob.find('/') == 0:
             glob = glob[1:]
         glob = posixpath.join(config_dirname, glob)
     else:
         glob = posixpath.join('**/', glob)
     return fnmatch(self.filename, glob)