Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-18 16:05:19 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-18 16:05:19 (GMT)
commitb8722e62394edb3c5e91e8195b01985b60389d86 (patch)
treed6f024c96acf562b5e713a5f7cc224a4bbd4c049
parentb4fecef2dd4931d27053910cefeb33fa0468bc16 (diff)
Fixes #1282.
-rw-r--r--documentnode.py3
-rw-r--r--downloadmanager.py5
2 files changed, 8 insertions, 0 deletions
diff --git a/documentnode.py b/documentnode.py
index ead07b6..29769f7 100644
--- a/documentnode.py
+++ b/documentnode.py
@@ -130,13 +130,16 @@ class DocumentNode:
file_output_stream = cls.createInstance(interfaces.nsIFileOutputStream)
file_output_stream.init(dest_file, -1, -1, 0)
+ # TODO: this is not reliable, sometimes reports 4096
bytes_to_read = http_input_stream.available()
while bytes_to_read:
buf = str(http_input_stream.read(min(8192, bytes_to_read)))
bytes_read = len(buf)
+ print "bytes_read %i" % bytes_read
bytes_to_write = bytes_read
while bytes_to_write:
bytes_written = file_output_stream.write(buf, bytes_read)
+ print "bytes_written %i" % bytes_written
bytes_to_write -= bytes_written
bytes_to_read -= bytes_read
diff --git a/downloadmanager.py b/downloadmanager.py
index 0451c77..37bdf34 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -147,6 +147,11 @@ class Download:
self._mime_type,
'file://' + self._target_file.path.encode('utf8'),
on_disk = True)
+ # Also add the 'text/uri-list' target for the same file path.
+ cb_service.add_object_format(self._cb_object_id,
+ 'text/uri-list',
+ 'file://' + self._target_file.path.encode('utf8'),
+ on_disk = True)
components.registrar.registerFactory('{23c51569-e9a1-4a92-adeb-3723db82ef7c}"',
'Sugar Download',