duplicity.util module¶
Miscellaneous utilities.
-
duplicity.util.
copyfileobj
(infp, outfp, byte_count=-1)[source]¶ Copy byte_count bytes from infp to outfp, or all if byte_count < 0
Returns the number of bytes actually written (may be less than byte_count if find eof. Does not close either fileobj.
-
duplicity.util.
escape
(string)[source]¶ Convert a (bytes) filename to a format suitable for logging (quoted utf8)
-
duplicity.util.
exception_traceback
(limit=50)[source]¶ - @return A string representation in typical Python format of the
- currently active/raised exception.
-
duplicity.util.
ignore_missing
(fn, filename)[source]¶ Execute fn on filename. Ignore ENOENT errors, otherwise raise exception.
@param fn: callable @param filename: string
-
duplicity.util.
maybe_ignore_errors
(fn)[source]¶ Execute fn. If the global configuration setting ignore_errors is set to True, catch errors and log them but do continue (and return None).
@param fn: A callable. @return Whatever fn returns when called, or None if it failed and ignore_errors is true.