MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / get_localizations

Method get_localizations

bleachbit/Unix.py:89–101  ·  view source on GitHub ↗

Returns all localization items for this object and all descendant objects

(self, basepath)

Source from the content-addressed store, hash-verified

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
104class Locales:

Callers 1

localization_pathsMethod · 0.80

Calls 3

get_subpathsMethod · 0.95
matchMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected