/[gentoo]/src/gwn/print-dev-stats.py
Gentoo

Contents of /src/gwn/print-dev-stats.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download) (as text)
Sun Dec 29 15:20:51 2013 UTC (4 years, 4 months ago) by hwoarang
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -0 lines
File MIME type: text/x-python
print-dev-stats.py: Also print main header

1 #!/usr/bin/env python
2
3 # Get devaway.xml from http://www.gentoo.org/dyn/devaway/devaway.xml?passthru=1
4 import xml.dom.minidom
5 import urllib2
6 import os
7
8 dev_rollcall = "/home/hwoarang/development/gentoo-cvs/gentoo/xml/htdocs/proj/en/devrel/roll-call/userinfo.xml"
9
10 devaway = open('devaway.txt', 'w')
11 devaway.write(urllib2.urlopen("http://www.gentoo.org/dyn/devaway/devaway.xml?passthru=1").read())
12 devaway.close()
13 dom = xml.dom.minidom.parse(dev_rollcall)
14 aom = xml.dom.minidom.parse("devaway.txt")
15
16 dev = dom.getElementsByTagName('user')
17 tot = len(dev)
18 awa = aom.getElementsByTagName('dev')
19 awa = len(awa)
20 cnt = 0
21
22 for d in dev:
23 ret = d.getElementsByTagName('status')
24 if not ret:
25 cnt += 1
26
27 print """
28 <h1>Gentoo Developer Moves</h1>
29 <h2>Summary</h2>
30 Gentoo is made up of <strong>%s</strong> active developers, of which <strong>%s</strong> are currently away.
31 Gentoo has recruited a total of <strong>%s</strong> developers since its inception.
32 """ % (cnt, awa, tot)
33
34 os.remove("devaway.txt")

  ViewVC Help
Powered by ViewVC 1.1.20