Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saving compiler result via storage backend #609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pipeline/compilers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def _compile(input_path):
compiler.compile_file(infile, outfile,
outdated=outdated, force=force)

return compiler.output_path(input_path, compiler.output_extension)
output_path = compiler.output_path(input_path, compiler.output_extension)
content = compiler.read_file(outfile)
compiler.save_file(output_path, content)

return output_path
else:
return input_path

Expand Down Expand Up @@ -149,3 +153,8 @@ def execute_command(self, command, cwd=None, stdout_captured=None):
os.rename(stdout.name, os.path.join(cwd or os.curdir, stdout_captured))
else:
os.remove(stdout.name)

def read_file(self, path):
system_path = self.output_path(path, self.output_extension)
with open(system_path) as fid:
return fid.read()