def load(self, config_path=None): """ Load configuration from file. If no config path is given, several directories are searched for a file named 'githubsurvivor.conf': the current directory, followed by the current user's home directory, then finally /etc. """ if not config_path: config_path = c.get_conf_file(self.DEFAULT_FILENAME, self.SEARCH_DIRS) if not config_path: raise Exception( 'No configuration provided, and none found at any of %s' % \ ', '.join(path.join(d, self.DEFAULT_FILENAME) for d in self.SEARCH_DIRS)) self._config = c.load(config_path or self._default_path())
def load(self, config_path=None): """ Load configuration from file. If no config path is given, several directories are searched for a file named 'githubsurvivor.conf': the current directory, followed by the current user's home directory, then finally /etc. """ if not config_path: config_path = c.get_conf_file(self.DEFAULT_FILENAME, self.SEARCH_DIRS) if not config_path: raise Exception( 'No configuration provided, and none found at any of %s' % \ ', '.join(path.join(d, self.DEFAULT_FILENAME) for d in self.SEARCH_DIRS)) self._config = c.load(config_path or self._default_path())