diff options
author | Lucian Branescu Mihaila <lucian.branescu@gmail.com> | 2009-11-29 16:43:26 (GMT) |
---|---|---|
committer | Lucian Branescu Mihaila <lucian.branescu@gmail.com> | 2009-11-29 16:43:26 (GMT) |
commit | 6d68f64c489b3bd6ff12325c203c3034ae8b760c (patch) | |
tree | 06c1b719ca0f5eacd653c4e5d21f5d43ef34c52d | |
parent | f44480de7cb18867f8ef86ca3353f4e2607de84a (diff) |
Handle nested directories inside data/, for keep offline.
-rw-r--r-- | downloadmanager.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/downloadmanager.py b/downloadmanager.py index bde77bf..ec0923f 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -480,12 +480,12 @@ class _SaveDocumentProgressListener(object): def _create_zip(self): bundle = zipfile.ZipFile(self._zip_path, 'w', zipfile.ZIP_DEFLATED) - - bundle.write(os.path.join(self._temp_dir, 'index.html'), 'index.html') - data_path = os.path.join(self._temp_dir, 'data') - for i in os.listdir(data_path): - bundle.write(os.path.join(data_path, i), - os.path.join('data', i)) + + for root, dirs, files in os.walk(self._temp_dir): + for f in files: + bundle.write(os.path.join(self._temp_dir, root, f), + os.path.join(root, f)) + bundle.close() def _create_journal_object(self): |