Mercurial > piecrust2
diff foodtruck/views/publish.py @ 610:efc1dc916e7c
admin: Configuration changes.
* Move publish targets to site configuration.
* Add direct accessor for the current site.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 28 Jan 2016 22:17:58 -0800 |
parents | c6bc0ef03f82 |
children | e2e955a3bb25 |
line wrap: on
line diff
--- a/foodtruck/views/publish.py Thu Jan 28 22:16:47 2016 -0800 +++ b/foodtruck/views/publish.py Thu Jan 28 22:17:58 2016 -0800 @@ -4,7 +4,6 @@ import logging from flask import request, g, url_for, render_template, Response from flask.ext.login import login_required -from piecrust.configuration import merge_dicts from ..pubutil import PublishLogReader from ..views import with_menu_context from ..web import app @@ -21,12 +20,10 @@ if not target: raise Exception("No target specified.") - site = g.sites.get() - site.publish(target) + g.site.publish(target) - site = g.sites.get() - pub_cfg = copy.deepcopy(g.config.get('publish', {})) - merge_dicts(pub_cfg, site.config.get('publish', {})) + site = g.site + pub_cfg = copy.deepcopy(site.piecrust_app.config.get('publish', {})) if not pub_cfg: data = {'error': "There are not publish targets defined in your " "configuration file."} @@ -52,7 +49,7 @@ @app.route('/publish-log') @login_required def stream_publish_log(): - site = g.sites.get() + site = g.site pid_path = os.path.join(site.root_dir, '.ft_pub.pid') log_path = os.path.join(site.root_dir, '.ft_pub.log') rdr = PublishLogReader(pid_path, log_path)