Settings and configuration¶
Module is containing all necessary global variables for package.
Module also has ability to read user-defined data from two paths:
$HOME/_SETTINGS_PATH and /etc/_SETTINGS_PATH.
Note
If the first path is found, other is ignored.
Example of the configuration file ($HOME/edeposit/aleph.json):
{
"EDEPOSIT_EXPORT_SIGNATURE": "edeposit fancy signature",
"EDEPOSIT_EXPORT_REFERER": "from edeposit ^-^"
}
Attributes¶
-
aleph.settings.BASE_PATH= '/home/bystrousak/Plocha/Dropbox/c0d3z/prace/edeposit.amqp.aleph/src/edeposit/amqp/aleph'¶ Module’s path.
-
aleph.settings.ALEPH_DEFAULT_BASE= 'nkc'¶ Default base used to search in Aleph
-
aleph.settings.DEFAULT_LIBRARY= 'CZE01'¶ Default library in aleph.
-
aleph.settings.ALEPH_URL= 'http://aleph.nkp.cz'¶ URL used to read from Aleph. See Aleph’s X-service module.
-
aleph.settings.EDEPOSIT_EXPORT_SIGNATURE= 'edeposit'¶ Signature used when the module is writing to the Aleph
-
aleph.settings.EDEPOSIT_EXPORT_REFERER= 'edeposit'¶ Referer, which is used when module is writing to the Aleph
-
aleph.settings.ALEPH_EXPORT_URL= 'http://aleph.nkp.cz/aleph-cgi/e-deposit'¶ URL, of form, which is used to write to the Aleph
-
aleph.settings.get_all_constants()[source]¶ Get list of all uppercase, non-private globals (doesn’t start with
_).Returns: Uppercase names defined in globals() (variables from this module). Return type: list
-
aleph.settings.substitute_globals(config_dict)[source]¶ Set global variables to values defined in config_dict.
Parameters: config_dict (dict) – dictionary with data, which are used to set globals. Note
config_dict have to be dictionary, or it is ignored. Also all variables, that are not already in globals, or are not types defined in
_ALLOWED(str, int, float) or starts with_are silently ignored.