def pathfilter(path, mindate):
""" return whether path should not be processed based on mindate
return value of False indicates no filtering
return value of true indicates the path should be filtered
"""
if mindate == None:
return False
subdir = os.path.basename(path)
try:
if datetime.strptime(subdir, "%Y%m%d") < mindate:
logging.debug("Skip(1) subdir %s", subdir)
return True
except ValueError:
logging.debug("Skip(2) subdir %s", subdir)
return True
return False
评论列表
文章目录