Esempio n. 1
0
 def get_package_cache_path(self):
     """The path where plugin packages are stored."""
     h = hashlib.md5()
     h.update(self.id)
     h.update(sys.version)
     h.update(sys.prefix)
     return os.path.join(get_cache_dir(), 'packages', h.hexdigest())
Esempio n. 2
0
 def get_package_cache_path(self):
     """The path where plugin packages are stored."""
     h = hashlib.md5()
     h.update(self.id.encode("utf-8"))
     h.update(sys.version.encode("utf-8"))
     h.update(sys.prefix.encode("utf-8"))
     return os.path.join(get_cache_dir(), "packages", h.hexdigest())
Esempio n. 3
0
    def get_output_path(self):
        """The path where output files are stored."""
        config = self.open_config()
        output_path = config.get('project.output_path')
        if output_path:
            return os.path.join(self.tree, os.path.normpath(output_path))

        return os.path.join(get_cache_dir(), 'builds', self.id)
Esempio n. 4
0
def test_is_interesting(env):
    cache_dir = py.path.local(utils.get_cache_dir())
    build_dir = py.path.local("build")

    w = watcher.Watcher(env, str(build_dir))

    # This partial makes the testing code shorter
    is_interesting = functools.partial(w.is_interesting, 0, "generic")

    assert is_interesting("a.file")
    assert not is_interesting(".file")
    assert not is_interesting(str(cache_dir / "another.file"))
    assert not is_interesting(str(build_dir / "output.file"))

    w.output_path = None
    assert is_interesting(str(build_dir / "output.file"))
Esempio n. 5
0
def test_is_interesting(env):
    # pylint: disable=no-member
    cache_dir = py.path.local(utils.get_cache_dir())
    build_dir = py.path.local("build")

    w = watcher.Watcher(env, str(build_dir))

    # This partial makes the testing code shorter
    is_interesting = functools.partial(w.is_interesting, 0, "generic")

    assert is_interesting("a.file")
    assert not is_interesting(".file")
    assert not is_interesting(str(cache_dir / "another.file"))
    assert not is_interesting(str(build_dir / "output.file"))

    w.output_path = None
    assert is_interesting(str(build_dir / "output.file"))
Esempio n. 6
0
 def __init__(self, env, output_path=None):
     BasicWatcher.__init__(self, paths=[env.root_path] + env.theme_paths)
     self.env = env
     self.output_path = output_path
     self.cache_dir = os.path.abspath(get_cache_dir())
Esempio n. 7
0
 def get_output_path(self):
     """The path where output files are stored."""
     return os.path.join(get_cache_dir(), 'builds', self.id)