Esempio n. 1
0
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))
Esempio n. 2
0
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))
Esempio n. 3
0
 def identical(self, path):
     log.skip("identical  %s", path)
Esempio n. 4
0
 def skip(self, path):
     log.skip("skip  %s", path)
Esempio n. 5
0
 def identical(self, path):
     """:param path: path"""
     log.skip("identical  %s", path)
Esempio n. 6
0
 def skip(self, path):
     """:param path: path"""
     log.skip("skip  %s", path)
Esempio n. 7
0
 def identical(self, path):
     """:param path: path"""
     log.skip("identical  %s", path)
Esempio n. 8
0
 def skip(self, path):
     """:param path: path"""
     log.skip("skip  %s", path)