duplicity.globmatch module

exception duplicity.globmatch.FilePrefixError[source]

Bases: duplicity.globmatch.GlobbingError

Signals that a specified file doesn’t start with correct prefix

exception duplicity.globmatch.GlobbingError[source]

Bases: exceptions.Exception

Something has gone wrong when parsing a glob string


Returned regular expression equivalent to shell glob pat

Currently only the ?, , [], and * expressions are supported. Ranges like [a-z] are currently unsupported. There is no way to quote these special characters.

This function taken with minor modifications from efnmatch.py by Donovan Baarda.

duplicity.globmatch.select_fn_from_glob(glob_str, include, ignore_case=False)[source]

Return a function test_fn(path) which tests whether path matches glob, as per the Unix shell rules, taking as arguments a path, a glob string and include (0 indicating that the glob string is an exclude glob and 1 indicating that it is an include glob, returning: 0 - if the file should be excluded 1 - if the file should be included 2 - if the folder should be scanned for any included/excluded files None - if the selection function has nothing to say about the file

Note: including a folder implicitly includes everything within it.