This pull request introduces a feature to enhance file loading functionality across the WAS Node Suite by supporting environment variables in file paths. This change ensures that paths containing variables such as %userprofile% are correctly expanded and interpreted, allowing for more dynamic and flexible file loading.
Changes Made
WAS_Text_Load_Line_From_File:
Updated the load_file method to expand environment variables in the file_path using os.path.expandvars().
This change resolves an issue where paths with environment variables could not be found, resulting in errors.
WAS_Text_Load_From_File:
Applied the same update to the load_file method in this class to ensure consistent behavior.
Environment variables in the file_path are now properly expanded before the path is used.
Impact
Improved Flexibility: Users can now specify file paths that include environment variables, allowing the code to adapt to different user environments seamlessly.
Consistency: Both WAS_Text_Load_Line_From_File and WAS_Text_Load_From_File now handle file paths in the same manner, ensuring consistent behavior across the suite.
Additional Notes
I wanted to use %userprofile%\Documents\ as a file path. It was not supported, so I added this feature.
Overview
This pull request introduces a feature to enhance file loading functionality across the WAS Node Suite by supporting environment variables in file paths. This change ensures that paths containing variables such as
%userprofile%
are correctly expanded and interpreted, allowing for more dynamic and flexible file loading.Changes Made
WAS_Text_Load_Line_From_File:
load_file
method to expand environment variables in thefile_path
usingos.path.expandvars()
.WAS_Text_Load_From_File:
load_file
method in this class to ensure consistent behavior.file_path
are now properly expanded before the path is used.Impact
WAS_Text_Load_Line_From_File
andWAS_Text_Load_From_File
now handle file paths in the same manner, ensuring consistent behavior across the suite.Additional Notes
%userprofile%\Documents\
as a file path. It was not supported, so I added this feature.