Skip to content

Commit 87c4f76

Browse files
committed
view() has dry_run option for testing
1 parent 77d37b8 commit 87c4f76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ome_zarr/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def splitall(path):
129129
return allparts
130130

131131

132-
def view(input_path: str, port: int = 8000) -> None:
132+
def view(input_path: str, port: int = 8000, dry_run=False) -> None:
133133
# serve the parent directory in a simple server with CORS. Open browser
134134
parent_path, server_dir = os.path.split(input_path)
135135
# in case input_path had trailing slash, we go one level up...
@@ -224,6 +224,10 @@ def translate_path(self, path: str) -> str:
224224
print("No OME-Zarr files found in", input_path)
225225
return
226226

227+
# for testing
228+
if dry_run:
229+
return
230+
227231
# Open in browser...
228232
webbrowser.open(url)
229233

0 commit comments

Comments
 (0)