From f4d74c25e63844d7458c8c960f3e297894815a24 Mon Sep 17 00:00:00 2001 From: cshimm Date: Wed, 24 Apr 2024 11:54:03 -0700 Subject: [PATCH] prefix variable added. formatted prefix as 'file://' --- selene/core/configuration.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selene/core/configuration.py b/selene/core/configuration.py index daafcea8..6ad67e69 100644 --- a/selene/core/configuration.py +++ b/selene/core/configuration.py @@ -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