From 8237a2a0985a94f8a19505c6b1b4ba33612dc05c Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 29 Dec 2012 16:04:13 +0100 Subject: add_feed now uses templated. --- source/pyAggr3g470r.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 86ae81d7..7dafc52e 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -22,7 +22,7 @@ __author__ = "Cedric Bonhomme" __version__ = "$Revision: 3.6 $" __date__ = "$Date: 2010/01/29 $" -__revision__ = "$Date: 2012/12/04 $" +__revision__ = "$Date: 2012/12/19 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" @@ -446,8 +446,6 @@ class pyAggr3g470r(object): """ Add a new feed with the URL of a page. """ - html = "" - html += """
""" # search the feed in the HTML page with BeautifulSoup feed_url = utils.search_feed(url) if feed_url is None: @@ -457,12 +455,11 @@ class pyAggr3g470r(object): result = utils.add_feed(feed_url) # if the feed is not in the file feed.lst if result is False: - html += "

You are already following this feed!

" + message = "

You are already following this feed!

" else: - html += """

Feed added. You can now fetch your feeds.

""" - html += """\n
\nBack to the management page.
\n""" - html += "
\n" - return html + message = """

Feed added. You can now fetch your feeds.

""" + tmpl = lookup.get_template("confirmation.html") + return tmpl.render(message=message) add_feed.exposed = True @@ -596,4 +593,4 @@ if __name__ == '__main__': root = pyAggr3g470r() root.favicon_ico = cherrypy.tools.staticfile.handler(filename=os.path.join(conf.path + "/img/favicon.png")) cherrypy.config.update({'error_page.404': error_404}) - cherrypy.quickstart(root, "/" ,config=conf.path + "/cfg/cherrypy.cfg") + cherrypy.quickstart(root, "/" ,config=conf.path + "/cfg/cherrypy.cfg") \ No newline at end of file -- cgit