/[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 - (hide annotations) (download) (as text)
Mon May 9 00:58:15 2005 UTC (9 years, 3 months ago) by marduk
Branch: MAIN
CVS Tags: v1_3_1, release_1-5, HEAD
Branch point for: pre_2-0, v1_3
File MIME type: text/x-python
Code to handle the http://packages.gentoo.org/new/ page.

1 marduk 1.1 #!/usr/bin/python -OO
2    
3     __revision__ = "$Revision: $"
4     # $Source: $
5    
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    
13     new_ebuilds = gentoo.get_most_recent(db, new = True)
14    
15     html_list = [gentoo.ebuild_to_html(gentoo.query_to_dict(i), new = True,
16     show_bugs = False) for i in new_ebuilds]
17    
18     return '\n'.join(html_list)
19    
20    
21     def bumps_to_html(db):
22     """Gather revision bumps and convert to HTML"""
23    
24     bumps = gentoo.get_most_recent_bumps(db)
25     html_list = [gentoo.ebuild_to_html(gentoo.query_to_dict(i)) for i in bumps]
26    
27     return '\n'.join(html_list)
28    
29     def new_to_rss(db):
30     """Gather new ebuilds and convert to RSS"""
31    
32     new_ebuilds = gentoo.get_most_recent(db, new = True)
33     eb_dict = [gentoo.query_to_dict(i) for i in new_ebuilds]
34     gentoo.ebuilds_to_rss(sys.stdout, eb_dict, simple = True,
35     subtitle = 'New Packages')
36    
37     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    
46     else:
47     print new_to_html(db)

  ViewVC Help
Powered by ViewVC 1.1.20