def activate_virtualenv(self): """ activates virtualenv and adds module imports to a instance wide namespace. creating and activating a virtualenv onto the currently executing python interpreter is a bit black magic. Rather than having import statements added in various places within the script, we import them here immediately after we activate the newly created virtualenv """ VirtualenvMixin.activate_virtualenv(self) import boto import yaml import jinja2 self.virtualenv_imports = {"boto": boto, "yaml": yaml, "jinja2": jinja2} self.log("activated virtualenv with the modules: {}".format(str(self.virtualenv_imports)))
def activate_virtualenv(self): """ activates virtualenv and adds module imports to a instance wide namespace. creating and activating a virtualenv onto the currently executing python interpreter is a bit black magic. Rather than having import statements added in various places within the script, we import them here immediately after we activate the newly created virtualenv """ VirtualenvMixin.activate_virtualenv(self) import boto import yaml import jinja2 self.virtualenv_imports = { 'boto': boto, 'yaml': yaml, 'jinja2': jinja2, } self.log("activated virtualenv with the modules: {}".format(str(self.virtualenv_imports)))