mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
This commit is contained in:
parent
841c02c123
commit
4683d95580
@ -27,7 +27,6 @@ except ImportError: # pragma: no cover
|
||||
|
||||
|
||||
from argparse import ArgumentParser, RawTextHelpFormatter
|
||||
from bisect import insort
|
||||
|
||||
from six import StringIO
|
||||
|
||||
@ -167,9 +166,10 @@ class SortedCDXWriter(BaseCDXWriter):
|
||||
super(SortedCDXWriter, self).write(entry, filename)
|
||||
line = self.out.getvalue()
|
||||
if line:
|
||||
insort(self.sortlist, line)
|
||||
self.sortlist.append(line)
|
||||
|
||||
def __exit__(self, *args):
|
||||
self.sortlist.sort()
|
||||
self.actual_out.write(''.join(self.sortlist))
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user