There was an error while loading. Please reload this page.
1 parent c3188ce commit e74451fCopy full SHA for e74451f
sublime_virtualenv.py
@@ -39,6 +39,13 @@ def get_build_kwargs(self):
39
40
class RunOnVirtualenvCommand(sublime_plugin.WindowCommand):
41
def run(self, **kwargs):
42
- virtualenv = Virtualenv("/home/adrian/.virtualenvs/sublime_virtualenv")
+ venv_location = kwargs.pop('virtualenv', "")
43
+ virtualenv = self.get_virtualenv(venv_location)
44
deep_update(kwargs, virtualenv.get_build_kwargs())
- self.window.run_command('exec', kwargs)
45
+ self.window.run_command('exec', kwargs) # call built-in build command
46
+
47
+ def get_virtualenv(self, location=""):
48
+ if not location:
49
+ project_settings = self.window.project_data() or {}
50
+ location = project_settings.get('virtualenv')
51
+ return Virtualenv(location)
0 commit comments