def load(self): settings = SettingsContainer.read_os(self.settings_path) self.name = settings.get('service', 'name') self.domains = settings.get_list('service', 'domains') self.location = settings.get('service', 'location') self.ini = settings.get_list('service', 'ini') or ['production.ini'] self.master_settings = settings
def load(self): settings = SettingsContainer.read_os(self.settings_path) self.name = settings.get("service", "name") self.domains = settings.get_list("service", "domains") self.location = settings.get("service", "location") self.ini = settings.get_list("service", "ini") or ["production.ini"] self.master_settings = settings
def get_project_settings(cls, project_name): """Get the settings for a single project""" home_dir = os.environ.get("MOYA_SERVICE_HOME", None) or DEFAULT_HOME_DIR settings_path = os.path.join(home_dir, "moya.conf") try: with io.open(settings_path, "rt") as f: service_settings = SettingsContainer.read_from_file(f) except IOError: log.error("unable to read moya service settings from '{}'", settings_path) return -1 for path in cls._get_projects(service_settings, home_dir): try: settings = SettingsContainer.read_os(path) except Exception as e: log.error("error reading '%s' (%s)", path, e) if settings.get("service", "name", None) == project_name: return settings return None
def read_project(self, path): settings = SettingsContainer.read_os(path) return settings