Provides more detail on how to implement the settings file based on the pseudocode in #7 and design plan #8. Relates to this upsream issue.
Context
In a meeting with @bsteubing and @AnjeKnottnerus , it was decided that a user should be able to maintain their list of read-only = True/False databases between AB sessions (after close). The default is read-only=True. So only editable databases (read-only=False) must be stored in the settings file. To uniquely identify a database, the BW project that contains it must also be known.
Current state
- File "ab_settings.json" is created the first time a user changes an AB setting. It is saved on the local user machine in the location where the AB is run from, e.g.: C:\coding_projects\activity-browser\activity_browser
- Settings can currently only be changed by the user through ABWizard which is accessed via AB GUI > File > Settings.
- activity_browser/app/ui/widgets/settings_wizard.py class SettingsWizard() defines the interface and some behavior.
- activity_browser/app/settings.py class ABSettings() loads and writes the file.
Plan
Add the new read-only-related settings without interfering with existing behaviour
- this includes not saving over any pre-existing settings
- and ensuring 'restore defaults' functionality of settings wizard does not change the read-only settings
(preliminary research suggests the way settings are loaded and saved will handle these conditions automatically)
Proposed data structure
{ …other settings e.g. "startup_project": "Meta-analysis"…,
"projects": {
"Meta-analysis": {
"editable-databases": [ "Sandpit3.4","..." ]
}
}
}
Comments
- The top level key within the settings file: "projects", can contain other settings that related to the projects level of the BW/AB organisational hierarchy.
- Under this key, the unique project names are used as keys
- For each project, dbs that can be edited for a particlar project are saved as a list
- 'editable-databases sounds a bit clunky, open to alternative ideas
Provides more detail on how to implement the settings file based on the pseudocode in #7 and design plan #8. Relates to this upsream issue.
Context
In a meeting with @bsteubing and @AnjeKnottnerus , it was decided that a user should be able to maintain their list of read-only = True/False databases between AB sessions (after close). The default is read-only=True. So only editable databases (read-only=False) must be stored in the settings file. To uniquely identify a database, the BW project that contains it must also be known.
Current state
Plan
Add the new read-only-related settings without interfering with existing behaviour
(preliminary research suggests the way settings are loaded and saved will handle these conditions automatically)
Proposed data structure
{ …other settings e.g. "startup_project": "Meta-analysis"…,
"projects": {
"Meta-analysis": {
"editable-databases": [ "Sandpit3.4","..." ]
}
}
}
Comments