diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-05-17 20:50:34 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-05-17 20:50:34 +0000 |
commit | b7490436eb2a51749a33fe7c395bc961cfc633b4 (patch) | |
tree | e4c7b8015eeed3a681ffa946755799594f5fa827 /rdiff-backup/rdiff_backup/selection.py | |
parent | c3beb4a2425f1ca142f1c773ca8205399b48c993 (diff) | |
download | rdiff-backup-b7490436eb2a51749a33fe7c395bc961cfc633b4.tar.gz |
Added some error checking code, and a wrapper for easier profiling
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@89 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/selection.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/selection.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py index bd679de..aa98a49 100644 --- a/rdiff-backup/rdiff_backup/selection.py +++ b/rdiff-backup/rdiff_backup/selection.py @@ -125,11 +125,14 @@ class Select: for subdir in FilenameMapping.get_quoted_dir_children(dsrpath): for dsrp in rec_func(subdir, rec_func, sel_func): yield dsrp else: - dir_listing = dsrpath.listdir() - dir_listing.sort() - for filename in dir_listing: - for dsrp in rec_func(dsrpath.append(filename), - rec_func, sel_func): yield dsrp + for filename in Robust.listrp(dsrpath): + new_dsrp = Robust.check_common_error( + lambda: dsrpath.append(filename)) + if not new_dsrp: + Log("Error initializing file %s" % dsrpath.path, 2) + else: + for dsrp in rec_func(new_dsrp, rec_func, sel_func): + yield dsrp def iterate_starting_from(self, dsrpath, rec_func, sel_func): """Like Iterate, but only yield indicies > self.starting_index""" |