def _zip_dir()

in mwaairflow/nested_stacks/environment.py [0:0]


    def _zip_dir(self, dir_path, zip_path):
        zipf = zipfile.ZipFile(zip_path, mode="w")
        lendir_path = len(dir_path)
        for root, _, files in os.walk(dir_path):
            for file in files:
                file_path = os.path.join(root, file)
                zipf.write(file_path, file_path[lendir_path:])
        zipf.close()