1 | #!/usr/bin/python -OO |
1 | #!/usr/bin/python -OO |
2 | """These functions mainly take ebuild info (grabbed from the database and |
2 | """These functions mainly take ebuild info (grabbed from the database and |
3 | convert it to HTML. See the "main" function at the bottom.""" |
3 | convert it to HTML. See the "main" function at the bottom.""" |
4 | |
4 | |
5 | __revision__ = "$Revision: 1.4 $" |
5 | __revision__ = "$Revision: 1.5 $" |
6 | # $Source: /var/cvsroot/gentoo/src/packages/gentoo.py,v $ |
6 | # $Source: /var/cvsroot/gentoo/src/packages/gentoo.py,v $ |
7 | |
7 | |
8 | import config |
8 | import config |
9 | import os |
9 | import os |
10 | import time |
10 | import time |
… | |
… | |
318 | ebuild['time'].gmtime().strftime("%a, %d %b %Y %H:%M:%S +0000")) |
318 | ebuild['time'].gmtime().strftime("%a, %d %b %Y %H:%M:%S +0000")) |
319 | ) |
319 | ) |
320 | |
320 | |
321 | fp.write("</channel>\n</rss>\n") |
321 | fp.write("</channel>\n</rss>\n") |
322 | |
322 | |
323 | if __name__ == '__main__': |
323 | def main(argv=Null): |
|
|
324 | argv = argv or sys.argv |
324 | try: |
325 | try: |
325 | if sys.argv[1] == '-g': |
326 | if argv[1] == '-g': |
326 | ebuilddb.main() |
327 | ebuilddb.main() |
327 | except IndexError: |
328 | except IndexError: |
328 | pass |
329 | pass |
329 | |
330 | |
330 | db = ebuilddb.db_connect() |
331 | db = ebuilddb.db_connect() |
… | |
… | |
381 | |
382 | |
382 | rss2 = open(os.path.join(config.LOCALHOME, "archs", arch, branch, |
383 | rss2 = open(os.path.join(config.LOCALHOME, "archs", arch, branch, |
383 | config.RSS2), 'w') |
384 | config.RSS2), 'w') |
384 | ebuilds_to_rss(rss2, ebuilds, simple=True, subtitle=subtitle) |
385 | ebuilds_to_rss(rss2, ebuilds, simple=True, subtitle=subtitle) |
385 | rss.close() |
386 | rss.close() |
|
|
387 | |
|
|
388 | if __name__ == '__main__': |
|
|
389 | sys.exit(main()) |