Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pelican for openSUSE:Factory 
checked in at 2022-02-10 23:12:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pelican (Old)
 and      /work/SRC/openSUSE:Factory/.python-pelican.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pelican"

Thu Feb 10 23:12:10 2022 rev:18 rq:953059 version:4.7.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pelican/python-pelican.changes    
2021-10-26 20:14:24.710032565 +0200
+++ /work/SRC/openSUSE:Factory/.python-pelican.new.1956/python-pelican.changes  
2022-02-10 23:12:48.632319914 +0100
@@ -1,0 +2,10 @@
+Wed Feb  9 21:15:59 UTC 2022 - Beno??t Monin <benoit.mo...@gmx.fr>
+
+- update to version 4.7.2:
+  * Fix incorrect parsing of parameters specified via
+    -e / --extra-settings option flags (#2938)
+  * Add categories.html template to default theme (#2973)
+  * Document how to use plugins to inject content (#2922)
+- do not remove the shebang from jinja templates: fixed upstream
+
+-------------------------------------------------------------------

Old:
----
  pelican-4.7.1.tar.gz

New:
----
  pelican-4.7.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pelican.spec ++++++
--- /var/tmp/diff_new_pack.QBkEZf/_old  2022-02-10 23:12:49.204321363 +0100
+++ /var/tmp/diff_new_pack.QBkEZf/_new  2022-02-10 23:12:49.208321373 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pelican
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pelican
-Version:        4.7.1
+Version:        4.7.2
 Release:        0
 Summary:        A tool to generate a static blog from reStructuredText or 
Markdown input files
 License:        AGPL-3.0-only
@@ -103,8 +103,6 @@
 
 # remove useless shebang
 sed -i '1d' \
-    pelican/tools/templates/publishconf.py.jinja2 \
-    pelican/tools/templates/pelicanconf.py.jinja2 \
     pelican/tools/pelican_import.py \
     pelican/tools/pelican_themes.py \
     pelican/tools/pelican_quickstart.py

++++++ pelican-4.7.1.tar.gz -> pelican-4.7.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/.github/FUNDING.yml 
new/pelican-4.7.2/.github/FUNDING.yml
--- old/pelican-4.7.1/.github/FUNDING.yml       2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/.github/FUNDING.yml       2022-02-09 14:25:50.000000000 
+0100
@@ -1,2 +1,5 @@
+---
+
+github: justinmayer
 custom: https://donate.getpelican.com
 liberapay: pelican
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/docs/changelog.rst 
new/pelican-4.7.2/docs/changelog.rst
--- old/pelican-4.7.1/docs/changelog.rst        2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/docs/changelog.rst        2022-02-09 14:25:50.000000000 
+0100
@@ -1,6 +1,11 @@
 Release history
 ###############
 
+4.7.2 - 2022-02-09
+==================
+
+Fix incorrect parsing of parameters specified via `-e` / `--extra-settings` 
option flags (#2938).
+
 4.7.1 - 2021-10-12
 ==================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/docs/contribute.rst 
new/pelican-4.7.2/docs/contribute.rst
--- old/pelican-4.7.1/docs/contribute.rst       2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/docs/contribute.rst       2022-02-09 14:25:50.000000000 
+0100
@@ -21,10 +21,10 @@
 
 Please note that Python 3.6+ is required for Pelican development.
 
-*(Optional)* If you prefer to install Poetry once for use with multiple 
projects,
+*(Optional)* If you prefer to `install Poetry 
<https://python-poetry.org/docs/master/#installation>`_ once for use with 
multiple projects,
 you can install it via::
 
-    curl -sSL 
https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | 
python -
+    curl -sSL https://install.python-poetry.org | python3 -
 
 Point your web browser to the `Pelican repository`_ and tap the **Fork** button
 at top-right. Then clone the source for your fork and add the upstream project
@@ -51,7 +51,7 @@
 Your local environment should now be ready to go!
 
 .. _Pip: https://pip.pypa.io/
-.. _Poetry: https://poetry.eustace.io/docs/#installation
+.. _Poetry: https://python-poetry.org/
 .. _Pelican repository: https://github.com/getpelican/pelican
 
 Development
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/docs/plugins.rst 
new/pelican-4.7.2/docs/plugins.rst
--- old/pelican-4.7.1/docs/plugins.rst  2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/docs/plugins.rst  2022-02-09 14:25:50.000000000 +0100
@@ -301,6 +301,44 @@
         signals.get_writer.connect(add_writer)
 
 
+Using Plugins to Inject Content
+-------------------------------
+
+You can programmatically inject articles or pages using plugins. This can be
+useful if you plan to fetch articles from an API, for example.
+
+Following is a simple example of how one can build a plugin that injects a
+custom article, using the ``article_generator_pretaxonomy`` signal::
+
+    import datetime
+
+    from pelican import signals
+    from pelican.contents import Article
+    from pelican.readers import BaseReader
+
+    def addArticle(articleGenerator):
+        settings = articleGenerator.settings
+
+        # Author, category, and tags are objects, not strings, so they need to
+        # be handled using BaseReader's process_metadata() function.
+        baseReader = BaseReader(settings)
+
+        content = "I am the body of an injected article!"
+
+        newArticle = Article(content, {
+            "title": "Injected Article!",
+            "date": datetime.datetime.now(),
+            "category": baseReader.process_metadata("category", "fromAPI"),
+            "tags": baseReader.process_metadata("tags", "tagA, tagB")
+        })
+
+        articleGenerator.articles.insert(0, newArticle)
+
+    def register():
+        signals.article_generator_pretaxonomy.connect(addArticle)
+
+
+
 .. _Pip: https://pip.pypa.io/
 .. _pelican-plugins bug #314: 
https://github.com/getpelican/pelican-plugins/issues/314
 .. _Blinker: https://pythonhosted.org/blinker/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/docs/settings.rst 
new/pelican-4.7.2/docs/settings.rst
--- old/pelican-4.7.1/docs/settings.rst 2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/docs/settings.rst 2022-02-09 14:25:50.000000000 +0100
@@ -9,11 +9,12 @@
 If you used the ``pelican-quickstart`` command, your primary settings file will
 be named ``pelicanconf.py`` by default.
 
-You can also specify extra settings via ``-e`` / ``--extra-settings`` option
-flags, which will override default settings as well as any defined within
-settings files::
+You can also specify settings via ``-e`` / ``--extra-settings`` option
+flags. It will override default settings as well as any defined within the
+setting file. Note that values must follow JSON notation::
+
+    pelican content -e SITENAME='"A site"' READERS='{"html": null}' 
CACHE_CONTENT=true
 
-    pelican content -e DELETE_OUTPUT_DIRECTORY=true
 
 .. note::
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/__init__.py 
new/pelican-4.7.2/pelican/__init__.py
--- old/pelican-4.7.1/pelican/__init__.py       2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/pelican/__init__.py       2022-02-09 14:25:50.000000000 
+0100
@@ -1,4 +1,5 @@
 import argparse
+import json
 import logging
 import multiprocessing
 import os
@@ -24,7 +25,7 @@
 from pelican.plugins._utils import get_plugin_name, load_plugins
 from pelican.readers import Readers
 from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
-from pelican.settings import coerce_overrides, read_settings
+from pelican.settings import read_settings
 from pelican.utils import (FileSystemWatcher, clean_output_dir, 
maybe_pluralize)
 from pelican.writers import Writer
 
@@ -259,16 +260,29 @@
         parser.exit()
 
 
-class ParseDict(argparse.Action):
+class ParseOverrides(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
-        d = {}
-        if values:
-            for item in values:
-                split_items = item.split("=", 1)
-                key = split_items[0].strip()
-                value = split_items[1].strip()
-                d[key] = value
-        setattr(namespace, self.dest, d)
+        overrides = {}
+        for item in values:
+            try:
+                k, v = item.split("=", 1)
+            except ValueError:
+                raise ValueError(
+                    'Extra settings must be specified as KEY=VALUE pairs '
+                    f'but you specified {item}'
+                )
+            try:
+                overrides[k] = json.loads(v)
+            except json.decoder.JSONDecodeError:
+                raise ValueError(
+                    f'Invalid JSON value: {v}. '
+                    'Values specified via -e / --extra-settings flags '
+                    'must be in JSON notation. '
+                    'Use -e KEY=\'"string"\' to specify a string value; '
+                    '-e KEY=null to specify None; '
+                    '-e KEY=false (or true) to specify False (or True).'
+                )
+        setattr(namespace, self.dest, overrides)
 
 
 def parse_arguments(argv=None):
@@ -366,13 +380,13 @@
 
     parser.add_argument('-e', '--extra-settings', dest='overrides',
                         help='Specify one or more SETTING=VALUE pairs to '
-                             'override settings. If VALUE contains spaces, '
-                             'add quotes: SETTING="VALUE". Values other than '
-                             'integers and strings can be specified via JSON '
-                             'notation. (e.g., SETTING=none)',
+                             'override settings. VALUE must be in JSON 
notation: '
+                             'specify string values as SETTING=\'"some 
string"\'; '
+                             'booleans as SETTING=true or SETTING=false; '
+                             'None as SETTING=null.',
                         nargs='*',
-                        action=ParseDict
-                        )
+                        action=ParseOverrides,
+                        default={})
 
     args = parser.parse_args(argv)
 
@@ -385,6 +399,8 @@
 
 
 def get_config(args):
+    """Builds a config dictionary based on supplied `args`.
+    """
     config = {}
     if args.path:
         config['PATH'] = os.path.abspath(os.path.expanduser(args.path))
@@ -409,7 +425,7 @@
     if args.bind is not None:
         config['BIND'] = args.bind
     config['DEBUG'] = args.verbosity == logging.DEBUG
-    config.update(coerce_overrides(args.overrides))
+    config.update(args.overrides)
 
     return config
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/cache.py 
new/pelican-4.7.2/pelican/cache.py
--- old/pelican-4.7.1/pelican/cache.py  2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/cache.py  2022-02-09 14:25:50.000000000 +0100
@@ -74,7 +74,7 @@
     """Subclass that also caches the stamp of the file"""
 
     def __init__(self, settings, cache_name, caching_policy, load_policy):
-        """This sublcass additionally sets filestamp function
+        """This subclass additionally sets filestamp function
         and base path for filestamping operations
         """
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/readers.py 
new/pelican-4.7.2/pelican/readers.py
--- old/pelican-4.7.1/pelican/readers.py        2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/pelican/readers.py        2022-02-09 14:25:50.000000000 
+0100
@@ -222,7 +222,14 @@
                 'Ensure exactly one top level section',
                 source_path)
 
-        for docinfo in document.traverse(docutils.nodes.docinfo):
+        try:
+            # docutils 0.18.1+
+            nodes = document.findall(docutils.nodes.docinfo)
+        except AttributeError:
+            # docutils 0.18.0 or before
+            nodes = document.traverse(docutils.nodes.docinfo)
+
+        for docinfo in nodes:
             for element in docinfo.children:
                 if element.tagname == 'field':  # custom fields (e.g. summary)
                     name_elem, body_elem = element.children
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/settings.py 
new/pelican-4.7.2/pelican/settings.py
--- old/pelican-4.7.1/pelican/settings.py       2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/pelican/settings.py       2022-02-09 14:25:50.000000000 
+0100
@@ -1,7 +1,6 @@
 import copy
 import importlib.util
 import inspect
-import json
 import locale
 import logging
 import os
@@ -659,25 +658,3 @@
             continue            # setting not specified, nothing to do
 
     return settings
-
-
-def coerce_overrides(overrides):
-    if overrides is None:
-        return {}
-    coerced = {}
-    types_to_cast = {int, str, bool}
-    for k, v in overrides.items():
-        if k not in DEFAULT_CONFIG:
-            logger.warning('Override for unknown setting %s, ignoring', k)
-            continue
-        setting_type = type(DEFAULT_CONFIG[k])
-        if setting_type not in types_to_cast:
-            coerced[k] = json.loads(v)
-        else:
-            try:
-                coerced[k] = setting_type(v)
-            except ValueError:
-                logger.debug('ValueError for %s override with %s, try to '
-                             'load as json', k, v)
-                coerced[k] = json.loads(v)
-    return coerced
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pelican-4.7.1/pelican/tests/output/basic/categories.html 
new/pelican-4.7.2/pelican/tests/output/basic/categories.html
--- old/pelican-4.7.1/pelican/tests/output/basic/categories.html        
2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tests/output/basic/categories.html        
2022-02-09 14:25:50.000000000 +0100
@@ -22,13 +22,17 @@
                     <li><a href="/category/yeah.html">yeah</a></li>
                 </ul></nav>
         </header><!-- /#banner -->
-    <h1>Categories on A Pelican Blog</h1>
+
+    <section id="content" class="body">
+    <h1>Categories for A Pelican Blog</h1>
     <ul>
         <li><a href="/category/bar.html">bar</a> (1)</li>
         <li><a href="/category/cat1.html">cat1</a> (4)</li>
         <li><a href="/category/misc.html">misc</a> (4)</li>
         <li><a href="/category/yeah.html">yeah</a> (1)</li>
     </ul>
+    </section>
+
         <section id="extras" class="body">
                 <div class="social">
                         <h2>social</h2>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pelican-4.7.1/pelican/tests/output/custom/categories.html 
new/pelican-4.7.2/pelican/tests/output/custom/categories.html
--- old/pelican-4.7.1/pelican/tests/output/custom/categories.html       
2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tests/output/custom/categories.html       
2022-02-09 14:25:50.000000000 +0100
@@ -26,13 +26,17 @@
                     <li><a href="./category/bar.html">bar</a></li>
                 </ul></nav>
         </header><!-- /#banner -->
-    <h1>Categories on Alexis' log</h1>
+
+    <section id="content" class="body">
+    <h1>Categories for Alexis' log</h1>
     <ul>
         <li><a href="./category/bar.html">bar</a> (1)</li>
         <li><a href="./category/cat1.html">cat1</a> (4)</li>
         <li><a href="./category/misc.html">misc</a> (4)</li>
         <li><a href="./category/yeah.html">yeah</a> (1)</li>
     </ul>
+    </section>
+
         <section id="extras" class="body">
                 <div class="blogroll">
                         <h2>links</h2>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pelican-4.7.1/pelican/tests/output/custom_locale/categories.html 
new/pelican-4.7.2/pelican/tests/output/custom_locale/categories.html
--- old/pelican-4.7.1/pelican/tests/output/custom_locale/categories.html        
2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tests/output/custom_locale/categories.html        
2022-02-09 14:25:50.000000000 +0100
@@ -26,13 +26,17 @@
                     <li><a href="./category/bar.html">bar</a></li>
                 </ul></nav>
         </header><!-- /#banner -->
-    <h1>Categories on Alexis' log</h1>
+
+    <section id="content" class="body">
+    <h1>Categories for Alexis' log</h1>
     <ul>
         <li><a href="./category/bar.html">bar</a> (1)</li>
         <li><a href="./category/cat1.html">cat1</a> (4)</li>
         <li><a href="./category/misc.html">misc</a> (4)</li>
         <li><a href="./category/yeah.html">yeah</a> (1)</li>
     </ul>
+    </section>
+
         <section id="extras" class="body">
                 <div class="blogroll">
                         <h2>links</h2>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/tests/test_cli.py 
new/pelican-4.7.2/pelican/tests/test_cli.py
--- old/pelican-4.7.1/pelican/tests/test_cli.py 1970-01-01 01:00:00.000000000 
+0100
+++ new/pelican-4.7.2/pelican/tests/test_cli.py 2022-02-09 14:25:50.000000000 
+0100
@@ -0,0 +1,72 @@
+import unittest
+
+from pelican import get_config, parse_arguments
+
+
+class TestParseOverrides(unittest.TestCase):
+    def test_flags(self):
+        for flag in ['-e', '--extra-settings']:
+            args = parse_arguments([flag, 'k=1'])
+            self.assertDictEqual(args.overrides, {'k': 1})
+
+    def test_parse_multiple_items(self):
+        args = parse_arguments('-e k1=1 k2=2'.split())
+        self.assertDictEqual(args.overrides, {'k1': 1, 'k2': 2})
+
+    def test_parse_valid_json(self):
+        json_values_python_values_map = {
+            '""': '',
+            'null': None,
+            '"string"': 'string',
+            '["foo", 12, "4", {}]': ['foo', 12, '4', {}]
+        }
+        for k, v in json_values_python_values_map.items():
+            args = parse_arguments(['-e', 'k=' + k])
+            self.assertDictEqual(args.overrides, {'k': v})
+
+    def test_parse_invalid_syntax(self):
+        invalid_items = ['k= 1', 'k =1', 'k', 'k v']
+        for item in invalid_items:
+            with self.assertRaises(ValueError):
+                parse_arguments(f'-e {item}'.split())
+
+    def test_parse_invalid_json(self):
+        invalid_json = {
+            '', 'False', 'True', 'None', 'some other string',
+            '{"foo": bar}', '[foo]'
+        }
+        for v in invalid_json:
+            with self.assertRaises(ValueError):
+                parse_arguments(['-e ', 'k=' + v])
+
+
+class TestGetConfigFromArgs(unittest.TestCase):
+    def test_overrides_known_keys(self):
+        args = parse_arguments([
+            '-e',
+            'DELETE_OUTPUT_DIRECTORY=false',
+            'OUTPUT_RETENTION=["1.txt"]',
+            'SITENAME="Title"'
+        ])
+        config = get_config(args)
+        config_must_contain = {
+            'DELETE_OUTPUT_DIRECTORY': False,
+            'OUTPUT_RETENTION': ['1.txt'],
+            'SITENAME': 'Title'
+        }
+        self.assertDictEqual(config, {**config, **config_must_contain})
+
+    def test_overrides_non_default_type(self):
+        args = parse_arguments([
+            '-e',
+            'DISPLAY_PAGES_ON_MENU=123',
+            'PAGE_TRANSLATION_ID=null',
+            'TRANSLATION_FEED_RSS_URL="someurl"'
+        ])
+        config = get_config(args)
+        config_must_contain = {
+            'DISPLAY_PAGES_ON_MENU': 123,
+            'PAGE_TRANSLATION_ID': None,
+            'TRANSLATION_FEED_RSS_URL': 'someurl'
+        }
+        self.assertDictEqual(config, {**config, **config_must_contain})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/tests/test_settings.py 
new/pelican-4.7.2/pelican/tests/test_settings.py
--- old/pelican-4.7.1/pelican/tests/test_settings.py    2021-10-12 
16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tests/test_settings.py    2022-02-09 
14:25:50.000000000 +0100
@@ -7,7 +7,7 @@
 
 from pelican.settings import (DEFAULT_CONFIG, DEFAULT_THEME,
                               _printf_s_to_format_field,
-                              coerce_overrides, configure_settings,
+                              configure_settings,
                               handle_deprecated_settings, read_settings)
 from pelican.tests.support import unittest
 
@@ -304,18 +304,3 @@
                          [(r'C\+\+', 'cpp')] +
                          self.settings['SLUG_REGEX_SUBSTITUTIONS'])
         self.assertNotIn('SLUG_SUBSTITUTIONS', settings)
-
-    def test_coerce_overrides(self):
-        overrides = coerce_overrides({
-            'ARTICLE_EXCLUDES': '["testexcl"]',
-            'READERS': '{"foo": "bar"}',
-            'STATIC_EXCLUDE_SOURCES': 'true',
-            'THEME_STATIC_DIR': 'theme',
-            })
-        expected = {
-            'ARTICLE_EXCLUDES': ["testexcl"],
-            'READERS': {"foo": "bar"},
-            'STATIC_EXCLUDE_SOURCES': True,
-            'THEME_STATIC_DIR': 'theme',
-        }
-        self.assertDictEqual(overrides, expected)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pelican-4.7.1/pelican/themes/notmyidea/templates/categories.html 
new/pelican-4.7.2/pelican/themes/notmyidea/templates/categories.html
--- old/pelican-4.7.1/pelican/themes/notmyidea/templates/categories.html        
1970-01-01 01:00:00.000000000 +0100
+++ new/pelican-4.7.2/pelican/themes/notmyidea/templates/categories.html        
2022-02-09 14:25:50.000000000 +0100
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block title %}{{ SITENAME }} - Categories{% endblock %}
+
+{% block content %}
+
+<section id="content" class="body">
+    <h1>Categories for {{ SITENAME }}</h1>
+    <ul>
+    {% for category, articles in categories|sort %}
+        <li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ 
articles|count }})</li>
+    {% endfor %}
+    </ul>
+</section>
+
+{% endblock %}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/tools/pelican_quickstart.py 
new/pelican-4.7.2/pelican/tools/pelican_quickstart.py
--- old/pelican-4.7.1/pelican/tools/pelican_quickstart.py       2021-10-12 
16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tools/pelican_quickstart.py       2022-02-09 
14:25:50.000000000 +0100
@@ -3,6 +3,7 @@
 import argparse
 import locale
 import os
+from typing import Mapping
 
 from jinja2 import Environment, FileSystemLoader
 
@@ -170,6 +171,16 @@
     return r
 
 
+def render_jinja_template(tmpl_name: str, tmpl_vars: Mapping, target_path: 
str):
+    try:
+        with open(os.path.join(CONF['basedir'], target_path),
+                  'w', encoding='utf-8') as fd:
+            _template = _jinja_env.get_template(tmpl_name)
+            fd.write(_template.render(**tmpl_vars))
+    except OSError as e:
+        print('Error: {}'.format(e))
+
+
 def main():
     parser = argparse.ArgumentParser(
         description="A kickstarter for Pelican",
@@ -306,46 +317,16 @@
     except OSError as e:
         print('Error: {}'.format(e))
 
-    try:
-        with open(os.path.join(CONF['basedir'], 'pelicanconf.py'),
-                  'w', encoding='utf-8') as fd:
-            conf_python = dict()
-            for key, value in CONF.items():
-                conf_python[key] = repr(value)
-
-            _template = _jinja_env.get_template('pelicanconf.py.jinja2')
-            fd.write(_template.render(**conf_python))
-            fd.close()
-    except OSError as e:
-        print('Error: {}'.format(e))
+    conf_python = dict()
+    for key, value in CONF.items():
+        conf_python[key] = repr(value)
+    render_jinja_template('pelicanconf.py.jinja2', conf_python, 
'pelicanconf.py')
 
-    try:
-        with open(os.path.join(CONF['basedir'], 'publishconf.py'),
-                  'w', encoding='utf-8') as fd:
-            _template = _jinja_env.get_template('publishconf.py.jinja2')
-            fd.write(_template.render(**CONF))
-            fd.close()
-    except OSError as e:
-        print('Error: {}'.format(e))
+    render_jinja_template('publishconf.py.jinja2', CONF, 'publishconf.py')
 
     if automation:
-        try:
-            with open(os.path.join(CONF['basedir'], 'tasks.py'),
-                      'w', encoding='utf-8') as fd:
-                _template = _jinja_env.get_template('tasks.py.jinja2')
-                fd.write(_template.render(**CONF))
-                fd.close()
-        except OSError as e:
-            print('Error: {}'.format(e))
-        try:
-            with open(os.path.join(CONF['basedir'], 'Makefile'),
-                      'w', encoding='utf-8') as fd:
-                py_v = 'python3'
-                _template = _jinja_env.get_template('Makefile.jinja2')
-                fd.write(_template.render(py_v=py_v, **CONF))
-                fd.close()
-        except OSError as e:
-            print('Error: {}'.format(e))
+        render_jinja_template('tasks.py.jinja2', CONF, 'tasks.py')
+        render_jinja_template('Makefile.jinja2', CONF, 'Makefile')
 
     print('Done. Your new project is available at %s' % CONF['basedir'])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pelican-4.7.1/pelican/tools/templates/Makefile.jinja2 
new/pelican-4.7.2/pelican/tools/templates/Makefile.jinja2
--- old/pelican-4.7.1/pelican/tools/templates/Makefile.jinja2   2021-10-12 
16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/tools/templates/Makefile.jinja2   2022-02-09 
14:25:50.000000000 +0100
@@ -72,7 +72,7 @@
        @echo '   make devserver-global               regenerate and serve on 
0.0.0.0    '
 {% if ssh %}
        @echo '   make ssh_upload                     upload the web site via 
SSH        '
-    @echo '   make sftp_upload                    upload the web site via SFTP 
      '
+       @echo '   make sftp_upload                    upload the web site via 
SFTP       '
        @echo '   make rsync_upload                   upload the web site via 
rsync+ssh  '
 {% endif %}
 {% if dropbox %}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pelican/utils.py 
new/pelican-4.7.2/pelican/utils.py
--- old/pelican-4.7.1/pelican/utils.py  2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pelican/utils.py  2022-02-09 14:25:50.000000000 +0100
@@ -230,6 +230,9 @@
     and converts spaces to hyphens.
 
     Took from Django sources.
+
+    For a set of sensible default regex substitutions to pass to regex_subs
+    look into pelican.settings.DEFAULT_CONFIG['SLUG_REGEX_SUBSTITUTIONS'].
     """
 
     import unicodedata
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/pyproject.toml 
new/pelican-4.7.2/pyproject.toml
--- old/pelican-4.7.1/pyproject.toml    2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/pyproject.toml    2022-02-09 14:25:50.000000000 +0100
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "pelican"
-version = "4.7.1"
+version = "4.7.2"
 description = "Static site generator supporting Markdown and reStructuredText"
 authors = ["Justin Mayer <ent...@gmail.com>"]
 license = "AGPLv3"
@@ -48,7 +48,7 @@
 lxml = "^4.3"
 markdown = "~3.3.4"
 typogrify = "^2.0"
-sphinx = "^3.0"
+sphinx = "<4.4.0"
 sphinx_rtd_theme = "^0.5"
 livereload = "^2.6"
 psutil = {version = "^5.7", optional = true}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/requirements/docs.pip 
new/pelican-4.7.2/requirements/docs.pip
--- old/pelican-4.7.1/requirements/docs.pip     2021-10-12 16:45:30.000000000 
+0200
+++ new/pelican-4.7.2/requirements/docs.pip     2022-02-09 14:25:50.000000000 
+0100
@@ -1,3 +1,3 @@
-sphinx
+sphinx<4.4.0
 sphinx_rtd_theme
 livereload
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pelican-4.7.1/setup.py new/pelican-4.7.2/setup.py
--- old/pelican-4.7.1/setup.py  2021-10-12 16:45:30.000000000 +0200
+++ new/pelican-4.7.2/setup.py  2022-02-09 14:25:50.000000000 +0100
@@ -6,7 +6,7 @@
 from setuptools import find_packages, setup
 
 
-version = "4.7.1"
+version = "4.7.2"
 
 requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments',
             'docutils>=0.15', 'pytz >= 0a', 'blinker', 'unidecode',

Reply via email to