MCPcopy Create free account
hub / github.com/PyTables/PyTables / make_subs

Function make_subs

tables/scripts/pt2to3.py:470–484  ·  view source on GitHub ↗

Make stubs.

(ns)

Source from the content-addressed store, hash-verified

468
469
470def make_subs(ns):
471 """Make stubs."""
472 names = new2oldnames if ns.reverse else old2newnames
473 s = r"(?<=\W)({})(?=\W)".format("|".join(list(names)))
474 if ns.ignore_previous:
475 s += r"(?!\s*?=\s*?previous_api(_property)?\()"
476 s += r"(?!\* to \*\w+\*)"
477 s += r"(?!\* parameter has been renamed into \*\w+\*\.)"
478 s += r"(?! is pending deprecation, import \w+ instead\.)"
479 subs = re.compile(s, flags=re.MULTILINE)
480
481 def repl(m):
482 return names.get(m.group(1), m.group(0))
483
484 return subs, repl
485
486
487def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected