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

Method get_subpaths

bleachbit/Unix.py:80–87  ·  view source on GitHub ↗

Returns direct subpaths for this object, i.e. either the named subfolder or all subfolders matching the pattern

(self, basepath)

Source from the content-addressed store, hash-verified

78 self.add_child(regex)
79
80 def get_subpaths(self, basepath):
81 """Returns direct subpaths for this object, i.e. either the named subfolder or all
82 subfolders matching the pattern"""
83 if isinstance(self.pattern, Pattern):
84 return (os.path.join(basepath, p) for p in os.listdir(basepath)
85 if self.pattern.match(p) and os.path.isdir(os.path.join(basepath, p)))
86 path = os.path.join(basepath, self.pattern)
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"""

Callers 1

get_localizationsMethod · 0.95

Calls 2

joinMethod · 0.80
matchMethod · 0.80

Tested by

no test coverage detected