# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # Duplicity is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with duplicity; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import errno from duplicity import librsync from duplicity import log from duplicity import util tmp_file_index = 1 def check_common_error(error_handler, function, args=()): u"""Apply function to args, if error, run error_handler on exception This only catches certain exceptions which seem innocent enough. """ # todo: import here to avoid circular dependency issue from duplicity import path try: return function(*args) # except (EnvironmentError, SkipFileException, DSRPPermError, # RPathException, Rdiff.RdiffException, # librsync.librsyncError, C.UnknownFileTypeError), exc: # TracebackArchive.add() except (IOError, EnvironmentError, librsync.librsyncError, path.PathException) as exc: if (not isinstance(exc, EnvironmentError) or hasattr(exc, u"errno") and errno.errorcode[exc.errno] in [u'EPERM', u'ENOENT', u'EACCES', u'EBUSY', u'EEXIST', u'ENOTDIR', u'ENAMETOOLONG', u'EINTR', u'ENOTEMPTY', u'EIO', u'ETXTBSY', u'ESRCH', u'EINVAL']): # Log.exception() if error_handler: return error_handler(exc, *args) else: # Log.exception(1, 2) raise def listpath(path): u"""Like path.listdir() but return [] if error, and sort results""" def error_handler(exc): log.Warn(_(u"Error listing directory %s") % path.uc_name) return [] dir_listing = check_common_error(error_handler, path.listdir) dir_listing.sort() return dir_listing
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
backends | Folder | 0755 |
|
|
__init__.py | File | 1.08 KB | 0644 |
|
_librsync.cpython-38-x86_64-linux-gnu.so | File | 19.99 KB | 0644 |
|
asyncscheduler.py | File | 10.54 KB | 0644 |
|
backend.py | File | 25.55 KB | 0644 |
|
cached_ops.py | File | 1.64 KB | 0644 |
|
commandline.py | File | 51.33 KB | 0644 |
|
diffdir.py | File | 26.4 KB | 0644 |
|
dup_collections.py | File | 45.95 KB | 0644 |
|
dup_main.py | File | 65.43 KB | 0644 |
|
dup_temp.py | File | 8.1 KB | 0644 |
|
dup_threading.py | File | 8.56 KB | 0644 |
|
dup_time.py | File | 11.37 KB | 0644 |
|
errors.py | File | 2.66 KB | 0644 |
|
file_naming.py | File | 16.76 KB | 0644 |
|
filechunkio.py | File | 2.54 KB | 0644 |
|
globals.py | File | 10.19 KB | 0644 |
|
globmatch.py | File | 7.04 KB | 0644 |
|
gpg.py | File | 17.3 KB | 0644 |
|
gpginterface.py | File | 23.05 KB | 0644 |
|
lazy.py | File | 14.5 KB | 0644 |
|
librsync.py | File | 8.54 KB | 0644 |
|
log.py | File | 13.07 KB | 0644 |
|
manifest.py | File | 17.95 KB | 0644 |
|
patchdir.py | File | 21.78 KB | 0644 |
|
path.py | File | 27.73 KB | 0644 |
|
progress.py | File | 13.49 KB | 0644 |
|
robust.py | File | 2.42 KB | 0644 |
|
selection.py | File | 21.82 KB | 0644 |
|
statistics.py | File | 13.15 KB | 0644 |
|
tarfile.py | File | 1.26 KB | 0644 |
|
tempdir.py | File | 10.55 KB | 0644 |
|
util.py | File | 8.42 KB | 0644 |
|