aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-09-22 21:27:37 +0200
committercedricbonhomme <devnull@localhost>2010-09-22 21:27:37 +0200
commitebee8232877ae4d6a297967dad3a9fe7ed40abd6 (patch)
treec23fd640d68f131a59c9bf6537142361d9869c50 /pyAggr3g470r.py
parentRemoved useless comment. (diff)
downloadnewspipe-ebee8232877ae4d6a297967dad3a9fe7ed40abd6.tar.gz
newspipe-ebee8232877ae4d6a297967dad3a9fe7ed40abd6.tar.bz2
newspipe-ebee8232877ae4d6a297967dad3a9fe7ed40abd6.zip
Added more comments. Cleaner code.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 85605b88..1d530137 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -24,6 +24,7 @@ bindhost = "0.0.0.0"
cherrypy.config.update({ 'server.socket_port': 12556, 'server.socket_host': bindhost})
+# static files
path = {'/css/style.css': {'tools.staticfile.on': True, \
'tools.staticfile.filename':utils.path+'/css/style.css'}, \
'/css/img/feed-icon-28x28.png': {'tools.staticfile.on': True, \
@@ -56,6 +57,10 @@ path = {'/css/style.css': {'tools.staticfile.on': True, \
'tools.staticdir.dir': os.path.join(utils.path, './var/qrcode')}}
def htmlheader(nb_unread_articles=""):
+ """
+ Return the header of the HTML page with the number of unread articles
+ in the 'title' HTML tag..
+ """
return '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' + \
'<head>' + \
'\n\t<title>'+ nb_unread_articles +'pyAggr3g470r - RSS Feed Reader</title>\n' + \
@@ -76,6 +81,10 @@ htmlnav = '<body>\n<h1><div class="right innerlogo"><a href="/"><img src="/css/i
class Root:
+ """
+ Root class.
+ All pages of pyAggr3g470r are described in this class.
+ """
def index(self):
"""
Main page containing the list of feeds and articles.
@@ -97,6 +106,8 @@ class Root:
html += """<a href="/unread/All">Unread article(s): %s</a>\n""" % \
(self.nb_unread_articles,)
+
+ # The main page display all the feeds.
for rss_feed_id in self.feeds.keys():
html += """<h2><a name="%s"><a href="%s" rel="noreferrer"
target="_blank">%s</a></a>
bgstack15