Mercurial > hg > cc > cirrus_work
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/test_warc.py Wed Jul 05 15:37:16 2023 +0100 @@ -0,0 +1,17 @@ +import warc,sys + +OUT=open(sys.stdout.fileno(),'wb') + +if (debug:=(sys.argv[1]=='-d')): + sys.argv.pop(1) + +def showme(wtype,buf,part): + if debug: + breakpoint() + OUT.write(b"%d\n%b"%(part,buf)) + + +#warc(showme,[b'response','warcinfo','request','metadata'],int(sys.argv[2])) +#warc(showme,[b'response'],whole=True) + +warc.warc(sys.argv[1],showme,[b'response'],parts=int(sys.argv[2]),debug=debug)