MCPcopy Create free account
hub / github.com/gawel/pyquery / rep

Method rep

pyquery/pyquery.py:1664–1676  ·  view source on GitHub ↗
(i, e)

Source from the content-addressed store, hash-verified

1662
1663 def repl(attr):
1664 def rep(i, e):
1665 attr_value = self(e).attr(attr)
1666 # when label hasn't such attr, pass
1667 if attr_value is None:
1668 return None
1669
1670 # skip specific "protocol" schemas
1671 if any(attr_value.startswith(schema)
1672 for schema in ('tel:', 'callto:', 'sms:')):
1673 return None
1674
1675 return self(e).attr(attr,
1676 urljoin(base_url, attr_value.strip()))
1677 return rep
1678
1679 self('a').each(repl('href'))

Callers

nothing calls this directly

Calls 1

attrMethod · 0.80

Tested by

no test coverage detected