blob: 4ff968ebbcb9cb31ec2c441f7497d8c0859bd147 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Rework Fetching Settings
* assigned: bonfacem, zsloan, alex, fredm
* priority: low
* status: closed
* 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.
* closed
|