feed exports: removed dependency on file.tell() method, so that stdout output works

This commit is contained in:
Pablo Hoffman 2011-10-23 03:05:06 -02:00
parent 10ced29e18
commit 028bf3386d
1 changed files with 2 additions and 4 deletions

View File

@ -165,13 +165,11 @@ class FeedExporter(object):
if not slot.itemcount and not self.store_empty:
return
slot.exporter.finish_exporting()
nbytes = slot.file.tell()
logfmt = "%%s %s feed (%d items, %d bytes) in: %s" % (self.format, \
slot.itemcount, nbytes, slot.uri)
logfmt = "%%s %s feed (%d items) in: %s" % (self.format, \
slot.itemcount, slot.uri)
d = defer.maybeDeferred(slot.storage.store, slot.file)
d.addCallback(lambda _: log.msg(logfmt % "Stored", spider=spider))
d.addErrback(log.err, logfmt % "Error storing", spider=spider)
d.addBoth(lambda _: slot.file.close())
return d
def item_scraped(self, item, spider):