mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add feed_written signal
This commit is contained in:
parent
2b130fb4dd
commit
0093984861
3 changed files with 4 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ static_generator_init static_generator invoked in th
|
||||||
static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context
|
static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context
|
||||||
content_object_init content_object invoked at the end of Content.__init__ (see note below)
|
content_object_init content_object invoked at the end of Content.__init__ (see note below)
|
||||||
content_written path, context invoked each time a content file is written.
|
content_written path, context invoked each time a content file is written.
|
||||||
|
feed_written path, context, feed invoked each time a feed file is written.
|
||||||
================================= ============================ ===========================================================================
|
================================= ============================ ===========================================================================
|
||||||
|
|
||||||
The list is currently small, so don't hesitate to add signals and make a pull
|
The list is currently small, so don't hesitate to add signals and make a pull
|
||||||
|
|
|
||||||
|
|
@ -44,3 +44,4 @@ content_object_init = signal('content_object_init')
|
||||||
|
|
||||||
# Writers signals
|
# Writers signals
|
||||||
content_written = signal('content_written')
|
content_written = signal('content_written')
|
||||||
|
feed_written = signal('feed_written')
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,8 @@ class Writer(object):
|
||||||
with self._open_w(complete_path, encoding) as fp:
|
with self._open_w(complete_path, encoding) as fp:
|
||||||
feed.write(fp, 'utf-8')
|
feed.write(fp, 'utf-8')
|
||||||
logger.info('Writing %s', complete_path)
|
logger.info('Writing %s', complete_path)
|
||||||
|
|
||||||
|
signals.feed_written.send(complete_path, context=context, feed=feed)
|
||||||
return feed
|
return feed
|
||||||
finally:
|
finally:
|
||||||
locale.setlocale(locale.LC_ALL, old_locale)
|
locale.setlocale(locale.LC_ALL, old_locale)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue