diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-29 16:04:13 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-29 16:04:13 +0100 |
commit | 8237a2a0985a94f8a19505c6b1b4ba33612dc05c (patch) | |
tree | ed8d026de666a441da9f4e770d3793227a716c2a /source/pyAggr3g470r.py | |
parent | Removed global variables for HTML header and footer tags. (diff) | |
download | newspipe-8237a2a0985a94f8a19505c6b1b4ba33612dc05c.tar.gz newspipe-8237a2a0985a94f8a19505c6b1b4ba33612dc05c.tar.bz2 newspipe-8237a2a0985a94f8a19505c6b1b4ba33612dc05c.zip |
add_feed now uses templated.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-x | source/pyAggr3g470r.py | 15 |
1 files changed, 6 insertions, 9 deletions
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 += """<div class="left inner">""" # 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 += "<p>You are already following this feed!</p>" + message = "<p>You are already following this feed!</p>" else: - html += """<p>Feed added. You can now <a href="/fetch/">fetch your feeds</a>.</p>""" - html += """\n<br />\n<a href="/management/">Back to the management page.</a><br />\n""" - html += "<hr />\n" - return html + message = """<p>Feed added. You can now <a href="/fetch/">fetch your feeds</a>.</p>""" + 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 |