/[gentoo]/src/packages/weeks.py
Gentoo

Contents of /src/packages/weeks.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Thu Feb 19 01:49:53 2004 UTC (10 years, 8 months ago) by marduk
Branch: MAIN
Branch point for: packages_g_o
File MIME type: text/x-python
Initial revision

1 #!/usr/bin/python -OO
2
3 import time
4 import MySQLdb
5 from cgi import escape
6 import ebuilddb
7 import config
8 import gentoo
9
10 SECS_PER_DAY = 86400
11 DAYS = ('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')
12
13 def get_dayname(day):
14 return DAYS[day[6]]
15
16 def get_days_ebuilds(day):
17 c = db.cursor()
18 query = ('SELECT ebuild.category, '
19 'ebuild.name, '
20 'version, '
21 'when_found, '
22 'description, '
23 'changelog, '
24 'arch, '
25 'homepage, '
26 'license '
27 'FROM ebuild,package '
28 'WHERE TO_DAYS(when_found) = TO_DAYS("%s-%02d-%02d") '
29 'AND ebuild.name = package.name '
30 'AND ebuild.category = package.category '
31 'ORDER BY when_found DESC' %
32 (day[0],day[1],day[2]))
33 #print query
34 c.execute(query)
35 results = c.fetchall()
36 return results
37
38 today = time.time()
39 db = ebuilddb.db_connect()
40 for day in range(today,today - (7*SECS_PER_DAY),-SECS_PER_DAY):
41 #print day
42 gmtime = time.gmtime(day)
43 dayname = get_dayname(gmtime)
44 print ('<a href="%sdaily/%s/%02d/%02d/">%s</a>:<br>'
45 % (config.FEHOME,gmtime[0],gmtime[1],gmtime[2],dayname))
46 results = get_days_ebuilds(gmtime)
47 #print results
48 ebuilds = [ gentoo.query_to_dict(i) for i in results ]
49 #ebuilds.sort(ebuild_sort)
50 for ebuild in ebuilds:
51 print ('. <a class="altlink" title="%s" href="%sebuilds/?%s-%s">%s %s</a><br>' %
52 (escape(ebuild['description']),
53 config.FEHOME,
54 ebuild['name'],
55 ebuild['version'],
56 ebuild['name'],
57 ebuild['version']))
58 print '<br>'

  ViewVC Help
Powered by ViewVC 1.1.20