I am new to Sublime and Python so this may be a really simple question.
I wrote a custom sublime window command to perform builds using existing running versions of Visual Studio (based on the excellent visual_studio.vim plugin for gvim). Everything works splendidly (well as splendidly as you could expect when you use COM interop). One of the problems I have though is that I can’t pipe the output back to Sublime’s build system file regexp.
My build system is really simple and just calls the plugin.
{
"target": "vs_build_solution",
"file_regex": "(...*?)/(([0-9]*)/) : error C[0-9]*:(...*?)",
}
The custom command looks like this:
[code]class VsBuildSolution(sublime_plugin.WindowCommand):
def run(self):
dte_build_solution(0, _filename_output, _option_write_before_build)
fp_output = file (_filename_output, 'r')
output_msg = fp_output.read ()
fp_output.close()
sys.stderr.write(output_msg)
pass[/code]
Where _filename_output is, obviously enough, the file name of the Visual Studio output (i.e. the output of the build). I now want to pipe this output back to the Sublime build system but for the life of me I can’t seem to be able to do it. I tried the following and they just end up displaying the information in the Sublime console but no the sublime build results:
sys.stderr.write
sys.stdout.write
print
Every other build system example I’ve seen just ends up calling a shell command through the use of ‘exec’ so I am a bit stuck here.