Mike Pagano kirjoitti:
On Monday 07 April 2008 04:37:18 pm Petteri Räty wrote:
Petteri Räty kirjoitti:
So I wrote a new slacker script that gets the active developers from LDAP and checks the activity for the last 60 days. One repoman commit should equal a couple entries on history but not sure on that. robbat2 succested that we add the info to LDAP on who is expected to have commits so purely infra people would not show up. Current slacker script has the info hard coded. Posting to public as the info is available via anoncvs for example any way.


[EMAIL PROTECTED] ~ $ python slacker.py /var/cvsroot/CVSROOT/history
snip

I may be incorrect but I do believe I see some 'staff' level people without 
commit access on the list. We may want to exclude them along with the infra 
folks, also.

Guess I wasn't clear enough. There is no filtering in that list based on the developer role in Gentoo. It's all Gentoo developers marked as active in LDAP. We first need to add the LDAP attributes before we can add the filter to the script. Might as well attach the script too.

Regards,
Petteri
def fetch_nicks_from_ldap():
        import ldap
        l = ldap.initialize('ldap://ldap1.gentoo.org')
        l.set_option(ldap.OPT_X_TLS_DEMAND, True)
        l.start_tls_s()
        l.simple_bind_s()
        nicks = {}
        for entry in l.search_s('ou=devs,dc=gentoo,dc=org', ldap.SCOPE_ONELEVEL,
                                                        
filterstr='(&(gentooStatus=active)(uid=*))', attrlist=['uid']):
                        nicks[entry[1]['uid'][0]] = 0
        l.unbind()
        return nicks

import sys

if len(sys.argv) < 2:
        sys.stderr.write("Give CVS history file location.\n")
        sys.exit(1)

from  datetime import datetime,timedelta
start = datetime.now() - timedelta(days=60)
f = open(sys.argv[1],'r')
nicks = fetch_nicks_from_ldap()
for line in f:
        time,nick = line.split('|')[0:2]
        time = datetime.fromtimestamp(int(time[1:], 16))
        if time > start and nick in nicks:
                nicks[nick] += 1
f.close()

for t in sorted(nicks.items(), key=lambda(k,v):(v,k)):
        print "%d %s" % tuple(reversed(t))

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to