#!/usr/local/bin/python import string,sys if len(sys.argv) > 1 and sys.argv[1] == "-c": iam = "committers" title = "Apache Committers" else: iam = "projects" title = "Apache Committers by Project Modules" sys.stdout = open(iam+'.html', 'w') # populate dictionary fullname from passwd file fullname = {} for line in open('/etc/passwd','r').readlines(): data = string.split(line,':') # handle bogusness of comments in passwd if len(data) > 5: fullname[data[0]] = string.split(data[4],',')[0] # Now populate the members array members = {} for line in open('members.dat','r').readlines(): data = string.split(line) members[data[0]] = data[0] # populate dictionary module from avail file # tally tallies the no. of CVS modules the user is a member of module = {} module["cvs-committers"] = [] tally = {} for line in open('/home/cvs/CVSROOT/avail','r').readlines(): data = string.split(line,'|') if data[0]=='avail': for name in string.split(data[2][0:-1], ','): if iam == 'projects': if not module.has_key(name): module[name]=[] for id in string.split(data[1], ','): if iam == 'projects': if not id in module[name]: module[name].append(id) else: if not id in module["cvs-committers"]: module["cvs-committers"].append(id) if not tally.has_key(id): tally[id] = 1 else: tally[id] = tally[id] + 1 # front matter print '' print '' print '' + title + '' print '' print '' print '' print '' print '' print '

' + title + '

' print '' print '' print '' print '' print '' print '
' print '
' print '
' print '

Project Modules

' # produce an index modules = module.keys() modules.sort() cols=5 rows=(len(modules)+cols-1)/cols print '' for row in range(0,rows): print '' for col in range(0,cols): try: name=modules[row+col*rows] print '' except: break print '' print '
' + name + '
' # produce a sorted list of committers to each project print '
' for name in modules: print '

' + name + '

' print '' module[name].sort() for id in module[name]: if fullname.has_key(id): print ' ' print ' ' print ' ' print ' ' print '
', if members.has_key(id): print '' + id + '', else: print id, print '', if members.has_key(id): print '' + fullname[id] + ' ', else: print fullname[id], print '
' # closing print '
' print '' print ''