示例#1
0
    def get(self, path):
        srcpath = os.path.join(self.base, path)
        if not os.path.lexists(srcpath):
            return None

        for p in self.ignore:
            if mozpath.match(path, p):
                return None

        if self.find_executables and is_executable(srcpath):
            return ExecutableFile(srcpath)
        else:
            return File(srcpath)
示例#2
0
    def get(self, path):
        srcpath = os.path.join(self.base, path)
        if not os.path.lexists(srcpath):
            return None

        for p in self.ignore:
            if mozpath.match(path, p):
                return None

        if self.find_executables and is_executable(srcpath):
            return ExecutableFile(srcpath)
        else:
            return File(srcpath)
示例#3
0
    def _find_file(self, path):
        '''
        Actual implementation of FileFinder.find() when the given pattern
        corresponds to an existing file under the base directory.
        '''
        srcpath = os.path.join(self.base, path)
        if not os.path.exists(srcpath):
            return

        if is_executable(srcpath):
            yield path, ExecutableFile(srcpath)
        else:
            yield path, File(srcpath)
示例#4
0
    def _find_file(self, path):
        '''
        Actual implementation of FileFinder.find() when the given pattern
        corresponds to an existing file under the base directory.
        '''
        srcpath = os.path.join(self.base, path)
        if not os.path.exists(srcpath):
            return

        if self.find_executables and is_executable(srcpath):
            yield path, ExecutableFile(srcpath)
        else:
            yield path, File(srcpath)
示例#5
0
    def _find_file(self, path):
        """
        Actual implementation of FileFinder.find() when the given pattern
        corresponds to an existing file under the base directory.
        """
        srcpath = os.path.join(self.base, path)
        if not os.path.exists(srcpath):
            return

        for p in self.ignore:
            if mozpath.match(path, p):
                return

        if self.find_executables and is_executable(srcpath):
            yield path, ExecutableFile(srcpath)
        else:
            yield path, File(srcpath)