mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-03-12 04:35:40 -07:00
* Bump importlib-resources from 6.4.0 to 6.4.5 Bumps [importlib-resources](https://github.com/python/importlib_resources) from 6.4.0 to 6.4.5. - [Release notes](https://github.com/python/importlib_resources/releases) - [Changelog](https://github.com/python/importlib_resources/blob/main/NEWS.rst) - [Commits](https://github.com/python/importlib_resources/compare/v6.4.0...v6.4.5) --- updated-dependencies: - dependency-name: importlib-resources dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Update importlib-resources==6.4.5 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
27 lines
577 B
Python
27 lines
577 B
Python
"""
|
|
Generate zip test data files.
|
|
"""
|
|
|
|
import zipfile
|
|
|
|
import zipp
|
|
|
|
|
|
def make_zip_file(tree, dst):
|
|
"""
|
|
Zip the files in tree into a new zipfile at dst.
|
|
"""
|
|
with zipfile.ZipFile(dst, 'w') as zf:
|
|
for name, contents in walk(tree):
|
|
zf.writestr(name, contents)
|
|
zipp.CompleteDirs.inject(zf)
|
|
return dst
|
|
|
|
|
|
def walk(tree, prefix=''):
|
|
for name, contents in tree.items():
|
|
if isinstance(contents, dict):
|
|
yield from walk(contents, prefix=f'{prefix}{name}/')
|
|
else:
|
|
yield f'{prefix}{name}', contents
|