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.

Poznámka

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/docs/checkouts/readthedocs.org/user_builds/edeposit-amqp-aleph/checkouts/latest/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()[zdroj]

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

Vrací:Uppercase names defined in globals() (variables from this module).
Typ návratové hodnoty:
 list
aleph.settings.substitute_globals(config_dict)[zdroj]

Set global variables to values defined in config_dict.

Parametry:config_dict (dict) – dictionary with data, which are used to set globals.

Poznámka

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.