~duplicity-team/duplicity/0.7-series

« back to all changes in this revision

Viewing changes to duplicity/selection.py

  • Committer: ken
  • Date: 2016-07-28 14:19:13 UTC
  • mfrom: (1231.1.3 0.7-series)
  • Revision ID: ken-20160728141913-0p7bux6r2dzy91x5
* Merged in lp:~mwilck/duplicity/0.7-series
  - Speedup of path_matches_glob() by about 8x.  See
    https://code.launchpad.net/~mwilck/duplicity/0.7-series/+merge/301332
    for more details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from duplicity import diffdir
34
34
from duplicity import util  # @Reimport
35
35
from duplicity.globmatch import GlobbingError, FilePrefixError, \
36
 
    path_matches_glob
 
36
    path_matches_glob_fn
37
37
 
38
38
"""Iterate exactly the requested files in a directory
39
39
 
544
544
            ignore_case = True
545
545
 
546
546
        # Check to make sure prefix is ok
547
 
        if not path_matches_glob(self.rootpath, glob_str, include=1):
 
547
        if not path_matches_glob_fn(glob_str, include=1)(self.rootpath):
548
548
            raise FilePrefixError(glob_str)
549
549
 
550
 
        def sel_func(path):
551
 
            return path_matches_glob(path, glob_str, include, ignore_case)
552
 
 
553
 
        return sel_func
 
550
        return path_matches_glob_fn(glob_str, include, ignore_case)
554
551
 
555
552
    def exclude_older_get_sf(self, date):
556
553
        """Return selection function based on files older than modification date """