annotate master/bin/finalMerge.py @ 36:9d4f130073b8

merge the uploaded results of fixAndMerge
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 29 Nov 2018 13:41:27 +0000
parents
children beae6309d4ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 #!/usr/bin/env python3
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 import sys,re
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
3 mh={}
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
4 ms={}
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 for l in sys.stdin:
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6 (h,m,y,c)=l.split()
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7 if h=='http':
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
8 tab=mh
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 else:
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
10 tab=ms
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
11 key='%s\t%s'%(m,y)
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
12 tab[key]=tab.get(key,0)+int(c)
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
13 for (l,tab) in zip(['http','https'],[mh,ms]):
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
14 for k in sorted(tab.keys()):
9d4f130073b8 merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
15 print(l,k,tab[k],sep='\t')