From 00939848619f73ff88de3f099a6242276e67e8e6 Mon Sep 17 00:00:00 2001 From: Artemy Tregubenko Date: Sun, 20 Jul 2014 10:54:46 +0200 Subject: [PATCH] Add feed_written signal --- docs/plugins.rst | 1 + pelican/signals.py | 1 + pelican/writers.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/docs/plugins.rst b/docs/plugins.rst index a13d9dce..01e67810 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -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 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. +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 diff --git a/pelican/signals.py b/pelican/signals.py index e06b89ac..f858c249 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -44,3 +44,4 @@ content_object_init = signal('content_object_init') # Writers signals content_written = signal('content_written') +feed_written = signal('feed_written') diff --git a/pelican/writers.py b/pelican/writers.py index 65cd95d7..17f7d483 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -121,6 +121,8 @@ class Writer(object): with self._open_w(complete_path, encoding) as fp: feed.write(fp, 'utf-8') logger.info('Writing %s', complete_path) + + signals.feed_written.send(complete_path, context=context, feed=feed) return feed finally: locale.setlocale(locale.LC_ALL, old_locale)