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

Diff of /src/packages/new_ebuilds.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

  ViewVC Help
Powered by ViewVC 1.1.20