MCPcopy Index your code
hub / github.com/RustPython/RustPython / selector

Method selector

Lib/glob.py:373–388  ·  view source on GitHub ↗

Returns a function that selects from a given path, walking and filtering according to the glob-style pattern parts in *parts*.

(self, parts)

Source from the content-addressed store, hash-verified

371 return _compile_pattern(pat, seps, self.case_sensitive, self.recursive)
372
373 def selector(self, parts):
374 """Returns a function that selects from a given path, walking and
375 filtering according to the glob-style pattern parts in *parts*.
376 """
377 if not parts:
378 return self.select_exists
379 part = parts.pop()
380 if self.recursive and part == '**':
381 selector = self.recursive_selector
382 elif part in _special_parts:
383 selector = self.special_selector
384 elif not self.case_pedantic and magic_check.search(part) is None:
385 selector = self.literal_selector
386 else:
387 selector = self.wildcard_selector
388 return selector(part, parts)
389
390 def special_selector(self, part, parts):
391 """Returns a function that selects special children of the given path.

Callers 6

special_selectorMethod · 0.95
literal_selectorMethod · 0.95
wildcard_selectorMethod · 0.95
recursive_selectorMethod · 0.95
globMethod · 0.80
globMethod · 0.80

Calls 2

popMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected