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

Function generate

Lib/test/test_importlib/resources/update-zips.py:33–40  ·  view source on GitHub ↗
(suffix)

Source from the content-addressed store, hash-verified

31
32
33def generate(suffix):
34 root = pathlib.Path(__file__).parent.relative_to(os.getcwd())
35 zfpath = root / f'zipdata{suffix}/ziptestdata.zip'
36 with zipfile.ZipFile(zfpath, 'w') as zf:
37 for src, rel in walk(root / f'data{suffix}'):
38 dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix())
39 print(src, '->', dst)
40 zf.write(src, dst)
41
42
43def walk(datapath):

Callers

nothing calls this directly

Calls 5

as_posixMethod · 0.80
walkFunction · 0.70
printFunction · 0.50
relative_toMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected