mirror of https://github.com/scrapy/scrapy.git
Place brackets on own lines with JsonItemExporter.
Placing the opening and closing brackets on their own lines makes it slightly easier to sort lines after the `spider_closed` signal is fired.
This commit is contained in:
parent
19b585361e
commit
9c29215bef
|
|
@ -100,10 +100,10 @@ class JsonItemExporter(BaseItemExporter):
|
|||
self.first_item = True
|
||||
|
||||
def start_exporting(self):
|
||||
self.file.write(b"[")
|
||||
self.file.write(b"[\n")
|
||||
|
||||
def finish_exporting(self):
|
||||
self.file.write(b"]")
|
||||
self.file.write(b"\n]")
|
||||
|
||||
def export_item(self, item):
|
||||
if self.first_item:
|
||||
|
|
|
|||
Loading…
Reference in New Issue