Skip to content

getConfigSetting

Alexius Wadell edited this page Jan 10, 2017 · 1 revision

Syntax

value = Datamaster.getConfigSetting(key)

Description

value = Datamaster.getConfigSetting(key) Return the a string with the value assigned to the given key. getConfigSetting looks for the key first in config.ini at the location given by Datamaster.getPath, then in default.ini. If the key can not be found in either location or default.ini does not exist an error is thrown. If config.ini does not exist and empty file is created at Datamaster.getPath.

Datamaster Configuration

To allow for a degree of customization Datamaster reads certain values from configuration files namely default.ini which is tracked by git and config.ini which is not. This has the added benefit of allowing some universal parameters (such as the location of the datastore) to be set to default values and still allow for other (Such as the Google API keys used by DataReporter) to remain secret (or at least not openly public).

Keys Description
datastore_path Location of the datastore directory storing the exported *.mat files
master_directory Location of the SQLite Database used by Datamaster
client_id Google API Console Client Id used for authentication via OAuth
client_secret Google API Console Client Id used for authentication via OAuth

Setting Configuration Settings

Both default.ini and config.ini are plan text files that can be edited using any text editor. Each key-value pair must be placed on a separate line using the format: key-value. Below is an example configuration file:

datastore_path=C:\Users\Alex\OneDrive\ARG17\Datastore
master_directory_path=%datastore%\master_directory.sqlite

Macros

Macros can be used when setting key-values and will be replaced at run time by the relevant value

Macro Replacement
%datastore% Value specifed by the datastore_path key
%Datamaster% Value given by Datamaster.getPath