AdrianLC / sublime-text-virtualenv

Manage your virtualenvs directly from Sublime Text 3
https://github.com/AdrianLC/sublime-text-virtualenv
MIT License
36 stars 17 forks source link

cancel build #3

Open udybrill opened 9 years ago

udybrill commented 9 years ago

When running a python file using the virtualenv package, it is not possible to cancel the build using the 'Cancel Build' button located in Tools tab

tigeryell99 commented 9 years ago

I noticed this too.

brupelo commented 8 years ago

Package is great so far... but as commented already few months ago it's not possible to "Cancel build" when running a long execution python script. Anyone found a fix for this?

Thanks.

bgromov commented 6 years ago

Any update on this?

brupelo commented 6 years ago

I've stopped using this package long time ago but adding a cancel option is just trivial, something like this would probably do:

def run(self, **kwargs):
    if kwargs.get("kill", False):
        return super().run(**kwargs)

Just take a look to ExecCommand to see what that kill arguments means, hope that helps.

bgromov commented 6 years ago

@brupelo Thanks! I will have a look.

gregsadetsky commented 6 years ago

Solved it! :-) It's just a matter of adding "cancel": {"kill": true} to the build file!

PR - #14


If you want to fix it in your current version:

bgromov commented 6 years ago

@gregsadetsky Didn't work for me unfortunately. It gives an error:

__init__() got an unexpected keyword argument 'cancel'

What version of Sublime are you using? I am on v3, build 3143.

gregsadetsky commented 6 years ago

@bgromov hmm, strange...! I'm running build 3160

Would you mind trying it in that build and letting me know if that works? Thanks!

bgromov commented 6 years ago

@gregsadetsky I am using unregistered version so far, so dev builds are not available for me, at least that's what the official web-site says. Build 3143 is the latest official release.

Phuket2 commented 6 years ago

@gregsadetsky, thanks this worked perfectly for me, I also added "quiet": true