Mercurial > wikked
changeset 394:dbe7dde07e85
runserver: Fix wiki updater not being set properly.
The wiki updater was set but subsequently overwritten in the `runserver`
command along with all the wiki factory params. Now we store them on the
settings objects for the app to pick up on creation.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 14 Oct 2015 22:58:00 -0700 |
parents | 3219f8dd7868 |
children | fcd6caf13cf7 |
files | wikked/commands/web.py wikked/web.py wikked/wiki.py |
diffstat | 3 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/wikked/commands/web.py Wed Oct 14 22:56:34 2015 -0700 +++ b/wikked/commands/web.py Wed Oct 14 22:58:00 2015 -0700 @@ -84,9 +84,11 @@ if not ctx.args.no_update: wikked.settings.WIKI_AUTO_RELOAD = True + # Start with the Witch wiki parameters. + wikked.settings.WIKI_FACTORY_PARAMETERS = ctx.params + # Create/import the app. from wikked.web import app - app.wiki_params = ctx.params ctx.wiki.db.hookupWebApp(app) # Update if needed.
--- a/wikked/web.py Wed Oct 14 22:56:34 2015 -0700 +++ b/wikked/web.py Wed Oct 14 22:58:00 2015 -0700 @@ -108,14 +108,17 @@ # Set the default wiki parameters. -app.wiki_params = WikiParameters(wiki_root) +app.wiki_params = app.config.get('WIKI_FACTORY_PARAMETERS', None) +if app.wiki_params is None: + app.wiki_params = WikiParameters(wiki_root) # Just uncache pages when the user has edited one. -def autoreload_wiki_updater(wiki, url): +def uncaching_wiki_updater(wiki, url): + app.logger.debug("Uncaching all pages because %s was edited." % url) wiki.db.uncachePages(except_url=url, only_required=True) -app.wiki_params.wiki_updater = autoreload_wiki_updater +app.wiki_params.wiki_updater = uncaching_wiki_updater # Login extension.