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]
Represent duplicity data files
Based on the file name, files that are compressed or encrypted will have different open() methods.
- __init__(base, index=(), parseresults=None)[source]
The actual filename (no directory) must be the single element of the index, unless parseresults is given.
- class duplicity.path.Path(base, index=())[source]
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
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()
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.
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]
Delete a directory. Called by Path.deltree
- class duplicity.path.ROPath(index, stat=None)[source]
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.
Generate a tarfile.TarInfo object based on self
Doesn’t set size based on stat, because we may want to replace data wiht other stream. Size should be set separately by calling function.