Commit ca0bdf32 by Rémy Sanchez Committed by Timothée Peignier

move is_outdated to compiler

parent d1182201
......@@ -37,6 +37,7 @@ or just made Pipeline more awesome.
* Peter Baumgartner <pete@lincolnloop.com>
* Pierre Drescher <pierre.drescher@gmail.com>
* Remco Wendt <remco@maykinmedia.nl>
* Remy Sanchez <remy.sanchez@hyperthese.net>
* Sam Thomson <sammthomson@gmail.com>
* Sander Smits <jhmsmits@gmail.com>
* Sirex <sirexas@gmail.com>
......
......@@ -37,7 +37,7 @@ class Compiler(object):
outfile = self.output_path(infile, compiler.output_extension)
outdated = True
else:
outdated = self.is_outdated(input_path, output_path)
outdated = compiler.is_outdated(infile, outfile)
try:
compiler.compile_file(infile, outfile, outdated=outdated, force=force)
except CompilerError:
......@@ -53,12 +53,6 @@ class Compiler(object):
path = os.path.splitext(path)
return '.'.join((path[0], extension))
def is_outdated(self, infile, outfile):
try:
return self.storage.modified_time(infile) > self.storage.modified_time(outfile)
except (OSError, NotImplementedError):
return True
class CompilerBase(object):
def __init__(self, verbose, storage):
......@@ -80,6 +74,12 @@ class CompilerBase(object):
file.close()
return content
def is_outdated(self, infile, outfile):
try:
return self.storage.modified_time(infile) > self.storage.modified_time(outfile)
except (OSError, NotImplementedError):
return True
class SubProcessCompiler(CompilerBase):
def execute_command(self, command, content=None, cwd=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment