F95Checker
F95Checker copied to clipboard
Refactor File Writing to Use `data_path` for Logs
Description
This pull request introduces changes to the way f95checker handles file writing, specifically for log files. Previously, log files were being written directly to globals.self_path
, which could lead to clutter and issues in environments where self_path
is read-only or has restrictive permissions (such as when packaged for AUR). To address this, I've refactored the code to ensure all log files are neatly organized in a logs
subfolder within globals.data_path
. This change keeps the executable path clean, avoids clutter, and ensures compatibility with read-only or restricted permission environments.
Changes
-
globals.py
Adjustment: Ensured that alogs
subfolder is created withinglobals.data_path
if it doesn't already exist. This provides a dedicated space for storing log files. -
Refactored File Writing Operations:
- Adjusted all instances where log files (
login_broken.bin
,check_broken.bin
,notifs_broken.bin
,update_broken.bin
, andlog.txt
) were being written toglobals.self_path
. These files are now correctly written to thelogs
subfolder withinglobals.data_path
.
- Adjusted all instances where log files (
Motivation
The main motivation behind these changes is to maintain a clean executable path and to address potential issues with file writing permissions, especially when the application is packaged for distribution (e.g., AUR). By organizing log files into a dedicated subfolder within globals.data_path
, we not only avoid clutter but also circumvent the complications arising from read-only or restricted permission scenarios.
Testing
- I've done some manual testing to ensure that log files are correctly written to the new location.
- Verified that the application behaves as expected in environments where
self_path
is read-only. - Ensured backward compatibility and that existing functionalities are not affected by these changes.
Impact
- Users: This change is transparent to users but results in a cleaner application structure and potentially avoids issues related to file writing permissions.
- Developers: Developers need to be aware of the new log file location for debugging or log analysis purposes.
ref: https://github.com/Willy-JL/F95Checker/pull/122
oh man, when the final appimage pr drops, it will probably have an entire research paper attached :smiley:
i just can't ignore 😇
I poured my heart and soul into this tool
oh and i hate when people submit pull requests with a 315-line edit spread across 69 files and their PR description is simply
'Updated some files to have this.' 😑
A pull request should provide as much detail as possible. Although, I suppose my PR template might be overly elaborate for a modest +10/-6 PR... XD