Add warning for Application.add_source_parser()

This commit is contained in:
Takeshi KOMIYA
2016-04-24 11:41:22 +09:00
parent 57ad420b42
commit 59c40c24f3
3 changed files with 7 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ Features added
- ``app.add_directive``
- ``app.add_role``
- ``app.add_generic_role``
- ``app.add_source_parser``
- ``image.data_uri``
- ``image.nonlocal_uri``

View File

@@ -222,6 +222,7 @@ General configuration
* app.add_directive
* app.add_role
* app.add_generic_role
* app.add_source_parser
* image.data_uri
* image.nonlocal_uri
* ref.term

View File

@@ -788,6 +788,11 @@ class Sphinx(object):
def add_source_parser(self, suffix, parser):
self.debug('[app] adding search source_parser: %r, %r', (suffix, parser))
if suffix in self._additional_source_parsers:
self.warn('while setting up extension %s: source_parser for %r is '
'already registered, it will be overridden' %
(self._setting_up_extension[-1], suffix),
type='app', subtype='add_source_parser')
self._additional_source_parsers[suffix] = parser