Example #1
0
    def find(self, path, match, unmatch):
        found_file_list = []

        ## use match/unmatch to filter the find list
        match_re = None
        unmatch_re = None

        if len(match):
            match_re = re.compile(match)
        if len(unmatch):
            unmatch_re = re.compile(unmatch)

        ## find stuff
        file_list, dir_list = shell.find(self.native_path(path))
        file_list = file_list + dir_list

        ## if there are no filters
        if not (match_re or unmatch_re):
            for file in file_list:
                found_file_list.append(self.posix_path(file))
            return found_file_list

        ## filter file list
        for file in file_list:
            file = self.posix_path(file)

            if match_re and match_re.match(file):
                found_file_list.append(file)
                continue
            if unmatch_re and unmatch_re.match(file):
                continue
            if not match_re:
                found_file_list.append(file)

        return found_file_list
Example #2
0
    def find(self, path, match, unmatch):
        found_file_list = []

        ## use match/unmatch to filter the find list
        match_re = None
        unmatch_re = None

        if len(match): match_re = re.compile(match)
        if len(unmatch): unmatch_re = re.compile(unmatch)

        ## find stuff
        file_list, dir_list = shell.find(self.native_path(path))
        file_list = file_list + dir_list

        ## if there are no filters
        if not (match_re or unmatch_re):
            for file in file_list:
                found_file_list.append(self.posix_path(file))
            return found_file_list

        ## filter file list
        for file in file_list:
            file = self.posix_path(file)

            if match_re and match_re.match(file):
                found_file_list.append(file)
                continue
            if unmatch_re and unmatch_re.match(file):
                continue
            if not match_re:
                found_file_list.append(file)

        return found_file_list
Example #3
0
    def __buildFullFileList( self ):
        """__buildFullFileList()

        Builds the list of files to rebase. Picks up all dll's that are in or
        below the root node.
        """        
        self.__files = []
        # Get full list of files at targetDir location.
        ( files , dummy ) = shell.find( self.__targetDir )
        for file in files:
            # Now filter for only dll's.
            if re.search( '\.dll$' , file.lower() ):
                self.__files.append( file )