Commits

Thomas Figg  committed 39aff6e

avoding ArchiveRecord

  • Participants
  • Parent commits 7e0a439

Comments (0)

Files changed (6)

File hanzo/warcdump.py

 
 from optparse import OptionParser
 
-from .warctools import ArchiveRecord, WarcRecord, expand_files
+from .warctools import WarcRecord, expand_files
 
 parser = OptionParser(usage="%prog [options] warc warc warc")
 
         
     else:
         for name in expand_files(input_files):
-            fh = ArchiveRecord.open_archive(name, gzip="auto")
+            fh = WarcRecord.open_archive(name, gzip="auto")
             dump_archive(fh,name)
 
             fh.close()

File hanzo/warcextract.py

 from optparse import OptionParser
 from contextlib import closing
 
-from .warctools import ArchiveRecord, WarcRecord
+from .warctools import WarcRecord
 
 parser = OptionParser(usage="%prog [options] warc offset")
 
         else:
             offset = 0
 
-        with closing(ArchiveRecord.open_archive(filename=filename, gzip="auto")) as fh:
+        with closing(WarcRecord.open_archive(filename=filename, gzip="auto")) as fh:
             fh.seek(offset)
             dump_record(fh)
 

File hanzo/warcfilter.py

 
 from optparse import OptionParser
 
-from .warctools import ArchiveRecord, expand_files
+from .warctools import WarcRecord, expand_files
 
 parser = OptionParser(usage="%prog [options] pattern warc warc warc")
 
     out = sys.stdout
     pattern = re.compile(pattern)
     if not input_files:
-            fh = ArchiveRecord.open_archive(file_handle=sys.stdin, gzip=None)
+            fh = WarcRecord.open_archive(file_handle=sys.stdin, gzip=None)
             filter_archive(fh, options, pattern, out)
     else:
         for name in expand_files(input_files):
-            fh = ArchiveRecord.open_archive(name, gzip="auto")
+            fh = WarcRecord.open_archive(name, gzip="auto")
             filter_archive(fh, options, pattern,out)
             fh.close()
 

File hanzo/warcindex.py

 
 from optparse import OptionParser
 
-from .warctools import ArchiveRecord, expand_files
+from .warctools import WarcRecord, expand_files
 
 parser = OptionParser(usage="%prog [options] warc warc warc")
 
         
     print '#WARC filename offset warc-type warc-subject-uri warc-record-id content-type content-length'
     for name in expand_files(input_files):
-        fh = ArchiveRecord.open_archive(name, gzip="auto")
+        fh = WarcRecord.open_archive(name, gzip="auto")
 
         for (offset, record, errors) in fh.read_records(limit=None):
             if record:

File hanzo/warclinks.py

 from optparse import OptionParser
 from contextlib import closing
 
-from .warctools import ArchiveRecord, WarcRecord, expand_files
+from .warctools import WarcRecord, expand_files
 from .httptools import RequestMessage, ResponseMessage
 
 
 
     for warc in expand_files(warcs):
         try:
-            with closing(ArchiveRecord.open_archive(filename=warc, gzip="auto")) as fh:
+            with closing(WarcRecord.open_archive(filename=warc, gzip="auto")) as fh:
                 for link in extract_links_from_warcfh(fh):
                     print link
 

File hanzo/warcvalid.py

 
 from optparse import OptionParser
 
-from .warctools import ArchiveRecord, expand_files
+from .warctools import WarcRecord, expand_files
 
 parser = OptionParser(usage="%prog [options] warc warc warc")
 
     fh=None
     try:
         for name in expand_files(input_files):
-            fh = ArchiveRecord.open_archive(name, gzip="auto")
+            fh = WarcRecord.open_archive(name, gzip="auto")
 
             for (offset, record, errors) in fh.read_records(limit=None):
                 if errors: