MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / subfunc

Method subfunc

src/packagedcode/maven.py:523–537  ·  view source on GitHub ↗

Return the replacement value for a matched property key.

(matchobj)

Source from the content-addressed store, hash-verified

521 return text
522
523 def subfunc(matchobj):
524 """Return the replacement value for a matched property key."""
525 key = matchobj.group(1)
526 # does this key contain a substring?
527 real_key, start_end = _get_substring_expression(key)
528 if not start_end:
529 value = properties.get(key)
530
531 return value
532 # apply the substring transform
533 value = properties.get(real_key)
534 if not value:
535 return value
536 start, end = start_end
537 return substring(value, start, end)
538
539 result = pom.PROPERTY_RE.sub(subfunc, text)
540 # we loop a maximum of 5 times to avoid cases of infinite recursion

Callers

nothing calls this directly

Calls 4

substringFunction · 0.85
groupMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected