5569 if filetype == "__IGNORE__" |
5569 if filetype == "__IGNORE__" |
5570 ] |
5570 ] |
5571 |
5571 |
5572 dirs = [""] if recursiveSearch else self.subdirs[:] + [""] |
5572 dirs = [""] if recursiveSearch else self.subdirs[:] + [""] |
5573 for directory in dirs: |
5573 for directory in dirs: |
5574 skip = False |
5574 if any( |
5575 for ignore_pattern in ignore_patterns: |
5575 fnmatch.fnmatch(directory, ignore_pattern) |
5576 if fnmatch.fnmatch(directory, ignore_pattern): |
5576 for ignore_pattern in ignore_patterns |
5577 skip = True |
5577 ): |
5578 break |
|
5579 if skip: |
|
5580 continue |
5578 continue |
5581 |
5579 |
5582 curpath = os.path.join(self.ppath, directory) |
5580 curpath = os.path.join(self.ppath, directory) |
5583 try: |
5581 try: |
5584 newSources = os.listdir(curpath) |
5582 newSources = os.listdir(curpath) |
5609 dirs.append(d) # noqa: M569 |
5607 dirs.append(d) # noqa: M569 |
5610 continue |
5608 continue |
5611 |
5609 |
5612 filetype = "" |
5610 filetype = "" |
5613 bfn = os.path.basename(fn) |
5611 bfn = os.path.basename(fn) |
5614 for pattern in sorted(self.__pdata["FILETYPES"], reverse=True): |
5612 |
|
5613 # check against ignore patterns first (see issue 553) |
|
5614 if any( |
|
5615 fnmatch.fnmatch(bfn, ignore_pattern) |
|
5616 for ignore_pattern in ignore_patterns |
|
5617 ): |
|
5618 continue |
|
5619 |
|
5620 for pattern in self.__pdata["FILETYPES"]: |
5615 if fnmatch.fnmatch(bfn, pattern): |
5621 if fnmatch.fnmatch(bfn, pattern): |
5616 filetype = self.__pdata["FILETYPES"][pattern] |
5622 filetype = self.__pdata["FILETYPES"][pattern] |
5617 break |
5623 break |
5618 |
5624 |
5619 if ( |
5625 if ( |
5620 filetype in self.getFileCategories() |
5626 filetype in self.getFileCategories() |
5621 and fn not in self.__pdata[filetype] |
5627 and ( |
|
5628 fn not in self.__pdata[filetype] |
|
5629 and ( |
|
5630 filetype == "OTHERS" |
|
5631 and os.path.dirname(fn) not in self.__pdata["OTHERS"] |
|
5632 ) |
|
5633 ) |
5622 and ( |
5634 and ( |
5623 filetype != "TRANSLATIONS" |
5635 filetype != "TRANSLATIONS" |
5624 or ( |
5636 or ( |
5625 filetype == "TRANSLATIONS" |
5637 filetype == "TRANSLATIONS" |
5626 and ( |
5638 and ( |