def _get_config(self): conf = ShubConfig() conf.load(StringIO(json.dumps(self._default_config()))) if 'SHUB_APIKEY' in os.environ: conf.apikeys['default'] = os.environ['SHUB_APIKEY'] try: conf.load(self.storage.open('scrapinghub.yml')) except OSError: raise ('Need a `scrapinghub.yml` file to identify which project ' 'to deploy to. Find more information at: {}'.format( self.SHUB_DOCS_URL )) return conf
def _get_conf_with_yml(self, yml): conf = ShubConfig() conf.load(StringIO.StringIO(textwrap.dedent(yml))) return conf
def _get_conf_with_yml(self, yml): conf = ShubConfig() conf.load(six.StringIO(textwrap.dedent(yml))) return conf