duplicity.path module¶
Wrapper class around a file like “/usr/bin/env”
This class makes certain file operations more convenient and associates stat information with filenames
- class duplicity.path.DupPath(base, index=(), parseresults=None)[source]¶
Bases:
Path
Represent duplicity data files
Based on the file name, files that are compressed or encrypted will have different open() methods.
- class duplicity.path.Path(base, index=())[source]¶
Bases:
ROPath
Path class - wrapper around ordinary local files
Besides caching stat() results, this class organizes various file code.
- compare_recursive(other, verbose=None)[source]¶
Compare self to other Path, descending down directories
- get_canonical()[source]¶
Return string of canonical version of path
Remove “.”, and trailing slashes where possible. Note that it’s harder to remove “..”, as “foo/bar/..” is not necessarily “foo”, so we can’t use path.normpath()
- open(mode='rb')[source]¶
Return fileobj associated with self
Usually this is just the file data on disk, but can be replaced with arbitrary data using the setfileobj method.
- quote(s=None)[source]¶
Return quoted version of s (defaults to self.name)
The output is meant to be interpreted with shells, so can be used with os.system.
- regex_chars_to_quote = re.compile('[\\\\\\"\\$`]')¶
- class duplicity.path.PathDeleter[source]¶
Bases:
ITRBranch
Delete a directory. Called by Path.deltree
- class duplicity.path.ROPath(index, stat=None)[source]¶
Bases:
object
Read only Path
Objects of this class doesn’t represent real files, so they don’t have a name. They are required to be indexed though.
- compare_verbose(other, include_data=0)[source]¶
Compare ROPaths like __eq__, but log reason if different
This is placed in a separate function from __eq__ because __eq__ should be very time sensitive, and logging statements would slow it down. Used when verifying.
Only run if include_data is true.