Skip to content

Commit 2a62fb1

Browse files
committed
use crate.mode for clarity
1 parent c22a25a commit 2a62fb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rocrate/model/dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from urllib.parse import unquote
3131

3232
from .file_or_dir import FileOrDir
33-
from ..utils import is_url, iso_now
33+
from ..utils import is_url, iso_now, Mode
3434

3535

3636
class Dataset(FileOrDir):
@@ -75,7 +75,7 @@ def _copy_folder(self, base_path):
7575
errno.ENOENT, os.strerror(errno.ENOENT), path
7676
)
7777
abs_out_path.mkdir(parents=True, exist_ok=True)
78-
if not self.crate.source:
78+
if self.crate.mode == Mode.CREATE:
7979
self.crate._copy_unlisted(path, abs_out_path)
8080

8181
def write(self, base_path):
@@ -99,7 +99,7 @@ def _stream_folder_from_path(self, chunk_size=8192):
9999
raise FileNotFoundError(
100100
errno.ENOENT, os.strerror(errno.ENOENT), str(path)
101101
)
102-
if not self.crate.source:
102+
if self.crate.mode == Mode.CREATE:
103103
for root, _, files in os.walk(path):
104104
root = Path(root)
105105
for name in files:

0 commit comments

Comments
 (0)