Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Refactor Settings Management (#66)
Description
This pull request introduces significant refactoring to the settings management system. The key changes are as follows:
os.path.join
for better portabilitySETTINGS
dictionary to hold settings in memory.SettingsNotFoundError
to handle cases where settings are not initialized properly.init_settings()
method to initialize settings from JSON file._dump_settings()
method to save the current state ofSETTINGS
to the JSON file.update_setting()
andread_setting()
methods to interact with globalSETTINGS
dictionary.init_settings()
should only be called once, please ask for details on best usage, if unsure.Issues Addressed
How to Test:
Code Sample
Additional Notes
Future improvements could include moving the custom class into a dedicated exceptions file and integrating a logging library for better error tracking (noted in comments).
requirements.txt
, should be able to simply runpip install -r requirements.txt
front.py
andorca.py
setings
tosettings