Skip to content

Commit

Permalink
Fix issue where filename has a '.' (isodate on mac/linux).
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyer committed Jun 12, 2024
1 parent 22253cb commit 1fe216a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nion/swift/ExportDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def build_filepath(components: typing.List[str], extension: str, directory_path:

# stick components together for the first part of the filename, underscore delimited excluding blank component
filename = "_".join(s for s in components if s)
filename.replace(".", "_")

# check to see if filename is available, if so return that
test_filepath = directory_path / pathlib.Path(filename).with_suffix(extension)
Expand Down Expand Up @@ -203,7 +204,7 @@ def export_clicked(display_items: typing.Sequence[DisplayItem.DisplayItem], view
title = re.sub(r'[-\s]+', '-', title, flags=re.U)
components.append(title)
if viewmodel.include_date.value:
components.append(data_item.created_local.isoformat().replace(':', ''))
components.append(data_item.created_local.isoformat().replace(':', '').replace('.', '_'))
if viewmodel.include_dimensions.value:
components.append(
"x".join([str(shape_n) for shape_n in data_item.dimensional_shape]))
Expand Down

0 comments on commit 1fe216a

Please sign in to comment.