Skip to content

Commit

Permalink
wip: Creates zip file
Browse files Browse the repository at this point in the history
ntlhui committed Jul 25, 2023

Verified

This commit was signed with the committer’s verified signature.
renovate-bot Mend Renovate
1 parent aad84c9 commit 705346f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions e4e_data_management/data.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import json
import logging
import pickle
import zipfile
from dataclasses import dataclass
from hashlib import sha256
from pathlib import Path
@@ -513,3 +514,15 @@ def commit(self) -> List[Path]:
committed_files.extend(new_files)
self.staged_files = []
return committed_files

def create_zip(self, zip_path: Path) -> None:
"""Creates a .zip archive of this Dataset at the specified location
Args:
zip_path (Path): Path to .zip archive
"""
if zip_path.suffix.lower() != '.zip':
raise RuntimeError('Invalid suffix')

with zipfile.ZipFile(file=zip_path, mode='w') as handle:
pass

0 comments on commit 705346f

Please sign in to comment.