~dylanmccall/harvest/gsoc-client-stuff

« back to all changes in this revision

Viewing changes to scripts/age_list

  • Committer: Benjamin Drung
  • Date: 2008-08-23 22:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 99.
  • Revision ID: benjamin.drung@gmail.com-20080823224255-nrxkxw9s1xfhbb7n
* Added myself to AUTHORS
* Moved CSS formatting to harvest.css
* Moved header and footer generation to a function in xhtml.py
* small fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import os, operator, time
8
8
 
 
9
import xhtml
 
10
 
9
11
def main():
10
12
    database = db.DB()
11
13
    opportunities = database.get_list_of_open_opportunities()
13
15
 
14
16
    timestamps = list(set([a[4] for a in opportunities]))
15
17
    timestamps.sort(reverse=True)
16
 
    html = """<?xml version="1.0" encoding="utf-8" ?>
17
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
18
 
<html xmlns="http://www.w3.org/1999/xhtml">
19
 
<head>
20
 
  <title>Harvest</title>
21
 
  <style type="text/css">
22
 
    .buglink { font-size:smaller }
23
 
    tr.even { background-color:gainsboro }
24
 
  </style>
25
 
</head>
26
 
<body>"""
 
18
    html = xhtml.header("Harvest - New incoming items")
27
19
    for t in timestamps:
28
20
        html += "<h1>%s</h1>" % time.strftime("%F %R UTC", time.gmtime(t))
29
21
        html += "<table>"
41
33
</tr>""" % \
42
34
                        (o[3], o[3], o[3], o[0], o[1], 
43
35
                         o[5].split("/")[-1].split(".")[0])
44
 
        html += "</table>"
 
36
        html += "</table>\n"
45
37
 
46
 
    html += "%s\n</body>\n</html>" % util.html_report_timestamp()
 
38
    html += "%s\n" % util.html_report_timestamp()
 
39
    html += xhtml.footer()
47
40
 
48
41
    html_file = os.path.join(util.main_dir(), "age.html")
49
42
    if os.path.exists(html_file):