Exemplo n.º 1
0
    def compile_paths(self, paths, compilers, force=False):
        for index, input_path in enumerate(paths):
            for compiler in compilers:
                compiler = compiler(self.verbose)

                if path_is_url(input_path):
                    input_path = get_remote_path(input_path)

                if compiler.match_file(input_path):
                    output_path = compiler.output_path(input_path)
                    paths[index] = output_path
                    try:
                        infile = finders.find(input_path)
                        outfile = finders.find(output_path)
                        outdated = self.is_outdated(input_path, output_path)
                        compiler.compile_file(infile,
                                              outfile,
                                              outdated=outdated,
                                              force=force)
                    except CompilerError:
                        if not self.storage.exists(
                                output_path) or not settings.PIPELINE:
                            raise
                    input_path = output_path
        return paths
Exemplo n.º 2
0
    def sources(self):
        if not self._sources:
            paths = []
            for pattern in self.config.get('source_filenames', []):
                if path_is_url(pattern):
                    paths.append(pattern)
                    continue

                for path in glob(pattern):
                    if not path in paths:
                        paths.append(str(path))

            self._sources = paths
        return self._sources
Exemplo n.º 3
0
    def compile_paths(self, paths, compilers, force=False):
        for index, input_path in enumerate(paths):
            for compiler in compilers:
                compiler = compiler(self.verbose)

                if path_is_url(input_path):
                    input_path = get_remote_path(input_path)

                if compiler.match_file(input_path):
                    output_path = compiler.output_path(input_path)
                    paths[index] = output_path
                    try:
                        infile = finders.find(input_path)
                        outfile = finders.find(output_path)
                        outdated = self.is_outdated(input_path, output_path)
                        compiler.compile_file(infile, outfile, outdated=outdated, force=force)
                    except CompilerError:
                        if not self.storage.exists(output_path) or not settings.PIPELINE:
                            raise
                    input_path = output_path
        return paths
Exemplo n.º 4
0
 def get_url(self, path):
     if path_is_url(path):
         return path
     return default_storage.url(path)
Exemplo n.º 5
0
 def get_url(self, path):
     if path_is_url(path):
         return path
     return default_storage.url(path)