From 1d4d86c876f6a2b29a850212d915b3a0139c4a88 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 24 Mar 2013 10:13:52 -0400 Subject: [PATCH] settings: Rework the LESS_GENERATOR removal warning for easy extension Setting migration is something that will happen for multiple settings, and the more we can standardize the reporting procedure, the easier it will be to add new warnings. --- pelican/settings.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pelican/settings.py b/pelican/settings.py index b6092fb3..b9d46632 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -210,11 +210,6 @@ def configure_settings(settings): 'http://docs.getpelican.com/en/latest/settings.html#timezone ' 'for more information') - if 'LESS_GENERATOR' in settings: - logger.warning( - 'The LESS_GENERATOR setting has been removed in favor ' - 'of the Webassets plugin') - if 'OUTPUT_SOURCES_EXTENSION' in settings: if not isinstance(settings['OUTPUT_SOURCES_EXTENSION'], six.string_types): @@ -256,4 +251,13 @@ def configure_settings(settings): % PATH_KEY) settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] + for old,new,doc in [ + ('LESS_GENERATOR', 'the Webassets plugin', None), + ]: + if old in settings: + message = 'The {} setting has been removed in favor of {}' + if doc: + message += ', see {} for details' + logger.warning(message) + return settings