diff options
Diffstat (limited to 'restore.py')
-rw-r--r-- | restore.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -244,7 +244,7 @@ class AsyncRestore(gobject.GObject): self._bundle = zipfile.ZipFile(self._path, 'r') self._check_bundle() - entries = self._get_directories().items() + entries = self._get_directories() num_entries = len(entries) for position, (object_id, file_paths) in enumerate(entries): self._client_check_command() @@ -349,14 +349,17 @@ class AsyncRestore(gobject.GObject): """Get the names of top-level directories in bundle and of their files. """ contents = {} + order = [] for path in self._bundle.namelist(): if path.endswith('/'): continue directory, file_name = path.lstrip('/').split('/', 1) + if directory not in contents: + order.append(directory) contents.setdefault(directory, []).append(file_name) - return contents + return [(directory, contents[directory]) for directory in order] def _install_entry(self, object_id, file_paths): """Reassemble the given entry and save it to the data store. |