From 4cf09312a1a9df7af2fd5458458fba3bd7aa5062 Mon Sep 17 00:00:00 2001 From: Rafael Goncalves Martins Date: Tue, 12 Oct 2010 00:10:31 -0300 Subject: fixed a bug when running g-octave from the source tarball or the git repo. Thanks to Diego "Flameeyes" Pettenò by reporting. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g_octave/config.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/g_octave/config.py b/g_octave/config.py index 6dc1b4d..e703d11 100644 --- a/g_octave/config.py +++ b/g_octave/config.py @@ -51,18 +51,16 @@ class Config(object): self._fetch_phase = fetch_phase - my_config = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - '..', 'etc', 'g-octave.cfg.devel' - ) - if config_file is not None: - self._config_file = config_file - elif os.path.exists(my_config): - self._config_file = my_config - else: - self._config_file = '/etc/g-octave.cfg' + parsed_files = self._config.read([ + os.path.join( + os.path.dirname(os.path.abspath(__file__)), + '..', 'etc', 'g-octave.cfg' + ), + config_file or '/etc/g-octave.cfg', + ]) - self._config.read(self._config_file) + if len(parsed_files) == 0: + raise ConfigException('Configuration file not found.') _db = self._getattr('db') _overlay = self._getattr('overlay') -- cgit v1.2.3-65-gdbad