From d5ebaceffed0344a972c243cfde093238480cdaf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 4 Nov 2018 12:30:05 +0100 Subject: [PATCH] m.dox: properly clear everything on init(). It's not usual that init() is called more than once. Except in tests, there it breaks stuff. --- pelican-plugins/m/dox.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pelican-plugins/m/dox.py b/pelican-plugins/m/dox.py index 8cda075c..00427d54 100644 --- a/pelican-plugins/m/dox.py +++ b/pelican-plugins/m/dox.py @@ -36,10 +36,6 @@ import logging logger = logging.getLogger(__name__) -symbol_mapping = {} -symbol_prefixes = [''] -tagfile_basenames = [] - # Modified from __init__ to add support for queries and hashes link_regexp = re.compile(r'(?P.*) <(?P<link>[^?#]+)(?P<hash>[?#].+)?>') @@ -59,7 +55,11 @@ def init(pelicanobj): tagfiles = pelicanobj.settings.get('M_DOX_TAGFILES', []) - # Pre-round to populate subclasses + # Pre-round to populate subclasses. Clear everything in case we init'd + # before already. + tagfile_basenames = [] + symbol_mapping = {} + symbol_prefixes = [''] for tagfile, path, prefixes in tagfiles: tagfile_basenames += [(os.path.splitext(os.path.basename(tagfile))[0], path)] -- 2.30.2