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

Contents of /src/packages/new_ebuilds.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.4.1 - (hide annotations) (download) (as text)
Sat Jun 23 18:04:54 2007 UTC (7 years, 2 months ago) by marduk
Branch: v1_3
Changes since 1.1: +15 -15 lines
File MIME type: text/x-python
Clean up implementation of main RSS link and "subtitle". Fixes bug #111952

1 marduk 1.1 #!/usr/bin/python -OO
2    
3 marduk 1.1.4.1 __revision__ = "$Revision: 1.1 $"
4     # $Source: /var/cvsroot/gentoo/src/packages/new_ebuilds.py,v $
5 marduk 1.1
6     import sys
7     import gentoo
8     import ebuilddb
9    
10     def new_to_html(db):
11     """Gather new ebuilds and convert to HTML"""
12 marduk 1.1.4.1
13 marduk 1.1 new_ebuilds = gentoo.get_most_recent(db, new = True)
14 marduk 1.1.4.1
15     html_list = [gentoo.ebuild_to_html(gentoo.query_to_dict(i), new = True,
16 marduk 1.1 show_bugs = False) for i in new_ebuilds]
17 marduk 1.1.4.1
18 marduk 1.1 return '\n'.join(html_list)
19 marduk 1.1.4.1
20    
21 marduk 1.1 def bumps_to_html(db):
22     """Gather revision bumps and convert to HTML"""
23 marduk 1.1.4.1
24 marduk 1.1 bumps = gentoo.get_most_recent_bumps(db)
25     html_list = [gentoo.ebuild_to_html(gentoo.query_to_dict(i)) for i in bumps]
26 marduk 1.1.4.1
27 marduk 1.1 return '\n'.join(html_list)
28 marduk 1.1.4.1
29 marduk 1.1 def new_to_rss(db):
30     """Gather new ebuilds and convert to RSS"""
31 marduk 1.1.4.1
32 marduk 1.1 new_ebuilds = gentoo.get_most_recent(db, new = True)
33     eb_dict = [gentoo.query_to_dict(i) for i in new_ebuilds]
34 marduk 1.1.4.1 gentoo.ebuilds_to_rss(sys.stdout, eb_dict, simple = True,
35 marduk 1.1 subtitle = 'New Packages')
36 marduk 1.1.4.1
37 marduk 1.1 if __name__ == '__main__':
38     db = ebuilddb.db_connect()
39    
40     if len(sys.argv) > 1:
41     if sys.argv[1] == 'rss':
42     new_to_rss(db)
43     if sys.argv[1] == 'bumps':
44     print bumps_to_html(db)
45 marduk 1.1.4.1
46 marduk 1.1 else:
47     print new_to_html(db)

  ViewVC Help
Powered by ViewVC 1.1.20