diff options
author | Munyoki Kilyungi | 2022-09-25 21:37:36 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2022-09-25 21:37:36 +0300 |
commit | 40e70f16479ef246639b240d4b0a1e751be191b1 (patch) | |
tree | f1e694de9ee884ce1384b8630f6a48f02cb068df | |
parent | b602c2c651dca0ea43cc2fe59ec64c99298a5730 (diff) | |
download | gn-gemtext-40e70f16479ef246639b240d4b0a1e751be191b1.tar.gz |
Create a new issue on reworking settings
* issues/rework-settings.gmi: New file.
-rw-r--r-- | issues/rework-settings.gmi | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/issues/rework-settings.gmi b/issues/rework-settings.gmi new file mode 100644 index 0000000..e2e6885 --- /dev/null +++ b/issues/rework-settings.gmi @@ -0,0 +1,19 @@ +# Rework Fetching Settings + +* assigned: bonfacem, zsloan, alex, fredm +* tags: refactor + +In GN2, We fetch all our settings from the "wqflask.utility.tools". This module contains many functions that are only used once. As an example, consider this function which is defined in the aforementioned module: + +``` +def flat_files(subdir=None): + base = get_setting("GENENETWORK_FILES") + if subdir: + return assert_dir(base + "/" + subdir) + return assert_dir(base) +``` + +It's only used once in "wqflask/base/data_set/datasetgroup.py". ATM, now we have a more generic way of fetching settings from wqflask.database, appropriately called "get_setting". Perhaps, when this task is being worked on, we should move that "get_setting" to a more appropriately named module. + +Getting rid of how we currently fetch settings will make things less complex, and we get rid of many "asserts". This will force us to deal with missing values more gracefully; and as an example with how we handle missing values in global search using the Maybe Monad. + |