Skip to content

Instantly share code, notes, and snippets.

@drewdeponte
Created January 24, 2012 05:09
Show Gist options
  • Save drewdeponte/1668108 to your computer and use it in GitHub Desktop.
Save drewdeponte/1668108 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin, subprocess
class GuardCommand(sublime_plugin.WindowCommand):
def run(self):
guard_output_view = self.window.get_output_panel('guard')
self.window.run_command('show_panel', {'panel': 'output.guard'})
p = subprocess.Popen(['/Users/adeponte/bin/wrap_guard'], shell=True)
cur_line = p.stdout.readline
while (cur_line != ""):
edit = guard_output_view.begin_edit()
guard_output_view.insert(edit, guard_output_view.size(), cur_line)
guard_output_view.end_edit(edit)
cur_line = p.readline()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment