Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/restore.py
diff options
context:
space:
mode:
Diffstat (limited to 'restore.py')
-rw-r--r--restore.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/restore.py b/restore.py
index e8c73c0..dbf562c 100644
--- a/restore.py
+++ b/restore.py
@@ -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.