aleph.settings module

Contents

aleph.settings module

Module is containing all necessary global variables for module.

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.ALEPH_DEFAULT_BASE = 'nkc'

Default base used to search in 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.ALEPH_URL = 'http://aleph.nkp.cz'

URL used to read from Aleph. See Aleph’s X-service module.

aleph.settings.BASE_PATH = '/home/bystrousak/Plocha/prace/edeposit.amqp.aleph/docs/../src/edeposit/amqp/aleph'

Module’s path.

aleph.settings.EDEPOSIT_EXPORT_REFERER = 'edeposit'

Referer, which is used when module is writing to the Aleph

aleph.settings.EDEPOSIT_EXPORT_SIGNATURE = 1

Signature used when the module is writing to the Aleph

aleph.settings.SETTINGS_PATH = '/edeposit/aleph.json'

Path which is appended to default search paths ($HOME and /etc).

Note

It has to start with /. Variable is appended to the default search paths, so this doesn’t mean, that the path is absolute!

aleph.settings.get_all_constants()[source]

Get list of all uppercase, non-private globals (doesn’t start with _).

Returns:list – Uppercase names defined in globals() (variables from this module).
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.

Contents