MCPcopy Create free account
hub / github.com/cztomczak/cefpython / pack_directory

Function pack_directory

tools/build_distrib.py:437–452  ·  view source on GitHub ↗
(path, base_path)

Source from the content-addressed store, hash-verified

435
436
437def pack_directory(path, base_path):
438 if path.endswith(os.path.sep):
439 path = path[:-1]
440 # ext = ".zip" if WINDOWS or MAC else ".tar.gz"
441 ext = ".zip"
442 archive = path + ext
443 if os.path.exists(archive):
444 os.remove(archive)
445 if WINDOWS or MAC:
446 zip_directory(path, base_path=base_path, archive=archive)
447 else:
448 zip_directory(path, base_path=base_path, archive=archive)
449 # with tarfile.open(archive, "w:gz") as tar:
450 # tar.add(path, arcname=os.path.basename(path))
451 assert os.path.isfile(archive), archive
452 return archive
453
454
455def zip_directory(path, base_path, archive):

Callers 2

pack_prebuilt_cefFunction · 0.85
make_packagesFunction · 0.85

Calls 1

zip_directoryFunction · 0.85

Tested by

no test coverage detected