Add config-inited event

This commit is contained in:
Takeshi KOMIYA 2018-01-20 21:09:12 +09:00
parent ae620e16f7
commit 29df3a095a
4 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,8 @@ Deprecated
Features added Features added
-------------- --------------
* Add :event:`config-inited` event
Bugs fixed Bugs fixed
---------- ----------

View File

@ -500,6 +500,12 @@ handlers to the events. Example:
Emitted when the builder object has been created. It is available as Emitted when the builder object has been created. It is available as
``app.builder``. ``app.builder``.
.. event:: config-inited (app, config)
Emitted when the config object has been initialized.
.. versionadded:: 1.8
.. event:: env-get-outdated (app, env, added, changed, removed) .. event:: env-get-outdated (app, env, added, changed, removed)
Emitted when the environment determines which source files have changed and Emitted when the environment determines which source files have changed and

View File

@ -225,6 +225,7 @@ class Sphinx(object):
self.builder = self.create_builder(buildername) self.builder = self.create_builder(buildername)
# check all configuration values for permissible types # check all configuration values for permissible types
self.config.check_types() self.config.check_types()
self.emit('config-inited', self.config)
# set up source_parsers # set up source_parsers
self._init_source_parsers() self._init_source_parsers()
# set up the build environment # set up the build environment

View File

@ -27,6 +27,7 @@ if False:
# List of all known core events. Maps name to arguments description. # List of all known core events. Maps name to arguments description.
core_events = { core_events = {
'builder-inited': '', 'builder-inited': '',
'config-inited': 'config',
'env-get-outdated': 'env, added, changed, removed', 'env-get-outdated': 'env, added, changed, removed',
'env-get-updated': 'env', 'env-get-updated': 'env',
'env-purge-doc': 'env, docname', 'env-purge-doc': 'env, docname',