Closed CWestICL closed 9 months ago
Attention: Patch coverage is 48.38710%
with 16 lines
in your changes are missing coverage. Please review.
Project coverage is 82.45%. Comparing base (
a46e81e
) to head (5c3238f
). Report is 13 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
finesse/gui/logs_view.py | 55.55% | 8 Missing :warning: |
finesse/gui/main_window.py | 14.28% | 6 Missing :warning: |
finesse/logger.py | 66.66% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm assuming the functionality for opening files/folders is OS agnostic but would be good to check! Works as expected on Windows.
Hi @CWestICL. Just quickly before I review, just had an error loading the log file on Linux:
Traceback (most recent call last):
File "/home/jpturner/workspace/FINESSE/FINESSE/finesse/gui/logs_view.py", line 29, in open_log
self.log = max(self.files, key=os.path.getctime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen genericpath>", line 65, in getctime
FileNotFoundError: [Errno 2] No such file or directory: '/home/jpturner/.local/state/FINESSE/log\\20240215_16-17-26.log'
Looks like a Windows backslash file delimiter after FINESSE/log
. Works if I change back to the OS's file delimiter.
Ah ok, I've replaced the backslash. Could you check if it's working now?
Also, you mention in the PR description that it opens the log file in the default text editor - do you mean web browser?
When I was researching how to open a file in the OS's text editor, I found a StackExchange post saying webbrowser.open()
would work. And it does open NotePad on my Windows PC.
However I've just seen this in the Python docs:
Note that on some platforms, trying to open a filename using this function, may work and start the operating system’s associated program. However, this is neither supported nor portable.
So probably worth a check if it works on other OSs.
When I was researching how to open a file in the OS's text editor, I found a StackExchange post saying
webbrowser.open()
would work. And it does open NotePad on my Windows PC.However I've just seen this in the Python docs:
Note that on some platforms, trying to open a filename using this function, may work and start the operating system’s associated program. However, this is neither supported nor portable.
So probably worth a check if it works on other OSs.
It opens in my web browser. Seems weird that a something called webbrowser.open()
opens a file in a text editor 😅 Does it at least open as read-only?
It does not 😅 I might have to go back and find another way of doing this
Logs
added to the main window toolbar menu with two options:Open log
- Opens the current log file in the default text editorOpen file location
- Opens the log file dir in File ExplorerCloses #434