Mercurial > hg > cc > cirrus_work
comparison bin/test_warc.py @ 42:689a0e311cd2
make warc.py a library, separate out testing
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 05 Jul 2023 15:37:16 +0100 |
parents | |
children | 212da3fe3b19 |
comparison
equal
deleted
inserted
replaced
41:fa43c318749b | 42:689a0e311cd2 |
---|---|
1 import warc,sys | |
2 | |
3 OUT=open(sys.stdout.fileno(),'wb') | |
4 | |
5 if (debug:=(sys.argv[1]=='-d')): | |
6 sys.argv.pop(1) | |
7 | |
8 def showme(wtype,buf,part): | |
9 if debug: | |
10 breakpoint() | |
11 OUT.write(b"%d\n%b"%(part,buf)) | |
12 | |
13 | |
14 #warc(showme,[b'response','warcinfo','request','metadata'],int(sys.argv[2])) | |
15 #warc(showme,[b'response'],whole=True) | |
16 | |
17 warc.warc(sys.argv[1],showme,[b'response'],parts=int(sys.argv[2]),debug=debug) |