Mercurial > hg > cc > azure
annotate master/bin/finalMerge.py @ 58:a3edba8dab11
move to right place in tree
| author | Henry S. Thompson <ht@markup.co.uk> |
|---|---|
| date | Thu, 28 May 2020 09:56:42 +0000 |
| parents | beae6309d4ec |
| children |
| 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={} |
| 38 | 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 | |
|
36
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
9 for l in sys.stdin: |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
10 (h,m,y,c)=l.split() |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
11 if h=='http': |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
12 tab=mh |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
13 else: |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
14 tab=ms |
| 38 | 15 m=mm[m] |
|
36
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
16 key='%s\t%s'%(m,y) |
|
9d4f130073b8
merge the uploaded results of fixAndMerge
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
17 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
|
18 for (l,tab) in zip(['http','https'],[mh,ms]): |
| 38 | 19 for (k,v) in tab.items(): |
| 20 print(l,k,v,sep='\t') |
