Mercurial > hg > cc > azure
view master/bin/finalMerge.py @ 38:beae6309d4ec
final merge
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 29 Nov 2018 13:52:07 +0000 |
parents | 9d4f130073b8 |
children |
line wrap: on
line source
#!/usr/bin/env python3 import sys,re mh={} ms={} mm={} for (i,m) in enumerate(['0','Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']): mm[m]=i for l in sys.stdin: (h,m,y,c)=l.split() if h=='http': tab=mh else: tab=ms m=mm[m] key='%s\t%s'%(m,y) tab[key]=tab.get(key,0)+int(c) for (l,tab) in zip(['http','https'],[mh,ms]): for (k,v) in tab.items(): print(l,k,v,sep='\t')