def __call__(self, dirname=''): path = svn_utils.joinpath(dirname, self.path) if os.path.isfile(path): for path in self._finder(dirname,path): if os.path.isfile(path): yield path elif os.path.isdir(path): for item in self.find(path): yield item
def __call__(self, dirname=''): path = svn_utils.joinpath(dirname, self.path) if os.path.isfile(path): for path in self._finder(dirname, path): if os.path.isfile(path): yield path elif os.path.isdir(path): for item in self.find(path): yield item
def find(self, dirname=''): path = svn_utils.joinpath(dirname, self.entries_path) if not os.path.isfile(path): # entries file doesn't exist return for path in self._finder(dirname, path): if os.path.isfile(path): yield path elif os.path.isdir(path): for item in self.find(path): yield item
def _finder(self, dirname, filename): f = open(filename, 'rU') try: data = f.read() finally: f.close() for match in self.pattern.finditer(data): path = match.group(1) # postproc was formerly used when the svn finder # was an re_finder for calling unescape path = self.postproc(path) yield svn_utils.joinpath(dirname, path)