Home Download Buy Blog Forum Support

Start async build from plugin

Start async build from plugin

Postby Philippe on Sun Feb 12, 2012 11:12 pm

I'm working on a plugin where builds were executed synchronously using 'runcmd', which is ok when the command returns very quickly.

However now some targets may run during several seconds or even minutes, so it should be executed async and the output displayed in the console.

Ideally I'd like to run these commands like ST handles builds, but I need to fire them from my plugin and they are too complex to be "simple" ST builds.
Philippe
 
Posts: 4
Joined: Sat Jan 29, 2011 8:10 pm

Re: Start async build from plugin

Postby bizoo on Mon Feb 13, 2012 8:58 am

The standard Build command from ST2 is defined in "Sublime Text 2\Packages\Default\exec.py".
The main command is ExecCommand and you could call it with:
Code: Select all
window.run_command("exec", {"cmd": "mycmd"})

Look at the method definition for a complete list of parameter.

Philippe wrote:Ideally I'd like to run these commands like ST handles builds, but I need to fire them from my plugin and they are too complex to be "simple" ST builds.

If this command doesn't work for you, copy the source in a new MyExecCommand and adapt the code to your need.
Without more information, we couldn't know what's a complex command is.
Feel free to ask more if needed.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 7 guests