Returns all localization items for this object and all descendant objects
(self, basepath)
| 87 | return [path] if os.path.isdir(path) else [] |
| 88 | |
| 89 | def get_localizations(self, basepath): |
| 90 | """Returns all localization items for this object and all descendant objects""" |
| 91 | for path in self.get_subpaths(basepath): |
| 92 | for child in self.children: |
| 93 | if isinstance(child, LocaleCleanerPath): |
| 94 | yield from child.get_localizations(path) |
| 95 | elif isinstance(child, Pattern): |
| 96 | for element in os.listdir(path): |
| 97 | match = child.match(element) |
| 98 | if match is not None: |
| 99 | yield (match.group('locale'), |
| 100 | match.group('specifier'), |
| 101 | os.path.join(path, element)) |
| 102 | |
| 103 | |
| 104 | class Locales: |
no test coverage detected