Mercurial > hg > cc > cirrus_work
changeset 52:e20c64917805
better debugging output
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Fri, 07 Jul 2023 17:04:05 +0100 |
parents | c0b4359dd26a |
children | 0dc144bd027c |
files | bin/test_warc.py |
diffstat | 1 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/test_warc.py Fri Jul 07 17:03:52 2023 +0100 +++ b/bin/test_warc.py Fri Jul 07 17:04:05 2023 +0100 @@ -9,15 +9,18 @@ # This should exactly reproduce a complete warc file if called # as per version 1 below if debug: - OUT.write(b"%d\n%b"%(part,buf)) - else: - OUT.write(buf) - if buf[-1]!=b'\n': - OUT.write(b'\r\n') - if part==7: - OUT.write(b'\r\n') # to match complete file formatting + OUT.write(b"----start %d-----\n"%part) + OUT.write(buf) + if buf[-1]!=10: + OUT.write(b'\r\n') + if part==7: + OUT.write(b'\r\n') # to match complete file formatting + if debug: + OUT.write(b"----end %d-----\n"%part) + return OUT -# 1 warc.warc(sys.argv[1],showme,[b'response','warcinfo','request','metadata'],whole=True) +# 1 +warc.warc(sys.argv[1],showme,[b'response','warcinfo','request','metadata'],parts=int(sys.argv[2]),debug=debug) # 2 -warc.warc(sys.argv[1],showme,[b'response'],parts=int(sys.argv[2]),debug=debug) +#warc.warc(sys.argv[1],showme,[b'warcinfo'],parts=int(sys.argv[2]),debug=debug)