예제 #1
0
파일: hooks.py 프로젝트: chripo/acrylamid
def advanced(pool, pattern, force, normalize, action, translate, ns, path):
    """
    :param force: re-run task even when the source has not been modified
    :param pattern: a regular expression to match the original path
    :param func: function to run
    :param translate: path translation, e.g. /images/*.jpg -> /images/thumbs/*.jpg
    """
    if not re.match(pattern, normalize(path), re.I):
        return

    if force or modified(path, translate(path)):
        if isinstance(action, string_types):
            action = partial(run, action)
        pool.add_task(action, ns, path, translate(path))
    else:
        log.skip('skip  %s', translate(path))
예제 #2
0
파일: hooks.py 프로젝트: ra2003/acrylamid
def advanced(pool, pattern, force, normalize, action, translate, ns, path):
    """
    :param force: re-run task even when the source has not been modified
    :param pattern: a regular expression to match the original path
    :param func: function to run
    :param translate: path translation, e.g. /images/*.jpg -> /images/thumbs/*.jpg
    """
    if not re.match(pattern, normalize(path), re.I):
        return

    if force or modified(path, translate(path)):
        if isinstance(action, string_types):
            action = partial(execute, action)
        pool.add_task(action, ns, path, translate(path))
    else:
        log.skip('skip  %s', translate(path))
예제 #3
0
 def identical(self, path):
     log.skip("identical  %s", path)
예제 #4
0
 def skip(self, path):
     log.skip("skip  %s", path)
예제 #5
0
 def identical(self, path):
     """:param path: path"""
     log.skip("identical  %s", path)
예제 #6
0
 def skip(self, path):
     """:param path: path"""
     log.skip("skip  %s", path)
예제 #7
0
 def identical(self, path):
     """:param path: path"""
     log.skip("identical  %s", path)
예제 #8
0
 def skip(self, path):
     """:param path: path"""
     log.skip("skip  %s", path)