Skip to content

Commit

Permalink
prefix variable added. formatted prefix as 'file://'
Browse files Browse the repository at this point in the history
  • Loading branch information
cshimm committed Apr 24, 2024
1 parent 5d733a0 commit f4d74c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions selene/core/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,12 +1392,13 @@ def with_(self, **options_to_override) -> Config:

def _format_path_as_uri(self, path):
"""Converts a local file path to a URI that can be clicked in most editors and browsers."""
prefix = 'file://'
if os.name == 'nt': # Windows specific
# Replace backslashes with forward slashes and prepend with 'file:///'
return f"file:///{path.replace(os.sep, '/')}"
# Replace backslashes with forward slashes and prepend with 'file://'
return f"{prefix}{path.replace(os.sep, '/')}"
else:
# Unix-based paths
return f"file://{path}"
return f"{prefix}{path}"

def _generate_filename(self, prefix='', suffix=''):
path = self.reports_folder
Expand Down

0 comments on commit f4d74c2

Please sign in to comment.