def __init__(self, config_options=None, all_actions=None, default_actions=None, *args, **kwargs): config_options = config_options or firefox_ui_tests_config_options actions = [ 'clobber', 'checkout', 'create-virtualenv', 'run-tests', ] VCSToolsScript.__init__(self, config_options=config_options, all_actions=all_actions or actions, default_actions=default_actions or actions, *args, **kwargs) VirtualenvMixin.__init__(self) self.firefox_ui_repo = self.config['firefox_ui_repo'] self.firefox_ui_branch = self.config.get('firefox_ui_branch') if not self.firefox_ui_branch: self.fatal( 'Please specify --firefox-ui-branch. Valid values can be found ' 'in here https://github.com/mozilla/firefox-ui-tests/branches') self.installer_url = self.config.get('installer_url') self.installer_path = self.config.get('installer_path') if self.installer_path: self.installer_path = os.path.abspath(self.installer_path) if not os.path.exists(self.installer_path): self.critical('Please make sure that the path to the installer exists.') sys.exit(1)
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)))