From: Christian Herdtweck Date: Wed, 22 Jun 2016 15:15:29 +0000 (+0200) Subject: commented all the filtering debug logging X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=050367c9cb95a750e156ee06ed78333e97a45af1;p=python-delta-tar commented all the filtering debug logging --- diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index 9bf1ef3..86dc7da 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -300,24 +300,24 @@ class DeltaTar(object): if isinstance(i, str): # if the string matches, then continue if i == path: - self.logger.debug('filtering {!r}: == {}' - .format(path, i)) + #self.logger.debug('filtering {!r}: == {}' + # .format(path, i)) match = MATCH break # if the string ends with / it's a directory, and if the # path is contained in it, it is included if i.endswith('/') and path.startswith(i): - self.logger.debug('filtering {!r}: startswith({!r})' - .format(path, i)) + #self.logger.debug('filtering {!r}: startswith({!r})' + # .format(path, i)) match = MATCH break # if the string doesn't end with /, add it and do the same # check elif path.startswith(i + '/'): - self.logger.debug('filtering {!r}: startswith({!r} +/)' - .format(path, i)) + #self.logger.debug('filtering {!r}: startswith({!r} +/)' + # .format(path, i)) match = MATCH break @@ -328,25 +328,26 @@ class DeltaTar(object): dir_path += '/' if i.startswith(dir_path): - self.logger.debug('filtering {!r}: is parent of {}' - .format(path, i)) + #self.logger.debug('filtering {!r}: is parent of {}' + # .format(path, i)) match = PARENT_MATCH # if it's a reg exp, then we just check if it matches elif isinstance(i, re._pattern_type): if i.match(path): - self.logger.debug('filtering {!r}: matches regexp {}' - .format(path, i)) + #self.logger.debug('filtering {!r}: matches regexp {}' + # .format(path, i)) match = MATCH break else: self.logger.warn('Invalid pattern in included_files: %s' % str(i)) if match == NO_MATCH: - self.logger.debug('filtering {!r}: no match'.format(path)) + #self.logger.debug('filtering {!r}: no match'.format(path)) return NO_MATCH - else: - self.logger.debug('filtering {!r}: everything included'.format(path)) + #else: + # self.logger.debug('filtering {!r}: everything included'.format(path)) + # when a directory is in PARENT_MATCH, it doesn't matter if it's # excluded. It's subfiles will be excluded, but the directory itself @@ -357,33 +358,33 @@ class DeltaTar(object): if isinstance(e, str): # if the string matches, then exclude if e == path: - self.logger.debug('filtering {!r}: excluded'.format(path)) + #self.logger.debug('filtering {!r}: excluded'.format(path)) return NO_MATCH # if the string ends with / it's a directory, and if the # path starts with the directory, then exclude if e.endswith('/') and path.startswith(e): - self.logger.debug('filtering {!r}: excluded'.format(path)) + #self.logger.debug('filtering {!r}: excluded'.format(path)) return NO_MATCH # if the string doesn't end with /, do the same check with # the slash added elif path.startswith(e + '/'): - self.logger.debug('filtering {!r}: excluded'.format(path)) + #self.logger.debug('filtering {!r}: excluded'.format(path)) return NO_MATCH # if it's a reg exp, then we just check if it matches elif isinstance(e, re._pattern_type): if e.match(path): - self.logger.debug('filtering {!r}: excluded'.format(path)) + #self.logger.debug('filtering {!r}: excluded'.format(path)) return NO_MATCH else: self.logger.warn('Invalid pattern in excluded_files: %s' % str(e)) if self.filter_func: result = self.filter_func(path) - self.logger.debug('filtering {!r}: custom filter returns {}' - .format(path, result)) + #self.logger.debug('filtering {!r}: custom filter returns {}' + # .format(path, result)) return result return match