Mercurial > hg > cc > azure
comparison 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 |
comparison
equal
deleted
inserted
replaced
37:93de42761f9c | 38:beae6309d4ec |
---|---|
1 #!/usr/bin/env python3 | 1 #!/usr/bin/env python3 |
2 import sys,re | 2 import sys,re |
3 mh={} | 3 mh={} |
4 ms={} | 4 ms={} |
5 mm={} | |
6 for (i,m) in enumerate(['0','Jan','Feb','Mar','Apr','May','Jun', | |
7 'Jul','Aug','Sep','Oct','Nov','Dec']): | |
8 mm[m]=i | |
5 for l in sys.stdin: | 9 for l in sys.stdin: |
6 (h,m,y,c)=l.split() | 10 (h,m,y,c)=l.split() |
7 if h=='http': | 11 if h=='http': |
8 tab=mh | 12 tab=mh |
9 else: | 13 else: |
10 tab=ms | 14 tab=ms |
15 m=mm[m] | |
11 key='%s\t%s'%(m,y) | 16 key='%s\t%s'%(m,y) |
12 tab[key]=tab.get(key,0)+int(c) | 17 tab[key]=tab.get(key,0)+int(c) |
13 for (l,tab) in zip(['http','https'],[mh,ms]): | 18 for (l,tab) in zip(['http','https'],[mh,ms]): |
14 for k in sorted(tab.keys()): | 19 for (k,v) in tab.items(): |
15 print(l,k,tab[k],sep='\t') | 20 print(l,k,v,sep='\t') |