Skip to content

Commit 1f31538

Browse files
committed
Revert as_uri() logic. Move to LocalFilesystem.
1 parent cc31435 commit 1f31538

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/crystal/filesystem/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ def copystat(self, src: str, dst: str) -> None:
309309
* OSError
310310
"""
311311
shutil.copystat(src, dst)
312+
313+
def as_uri(self, path: str) -> str:
314+
return pathlib.Path(path).as_uri()
312315

313316

314317
class S3Filesystem(_AbstractFilesystem):

src/crystal/model/project.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,8 @@ def _apply_migrations(self,
785785
# HACK: Must also set icon location as a brittle absolute path
786786
# because Desktop Items doesn't understand the
787787
# 'metadata::custom-icon-name' GIO attribute.
788-
crystalproj_png_icon_url = 'file://' + url_quote(
789-
resources_.get_filepath('docicon.png'),
790-
safe='/',
788+
crystalproj_png_icon_url = lfs.as_uri(
789+
resources_.get_filepath('docicon.png')
791790
)
792791
try:
793792
gio.set(self.path, 'metadata::custom-icon', crystalproj_png_icon_url)

0 commit comments

Comments
 (0)