diff options
author | 2010-10-12 00:10:31 -0300 | |
---|---|---|
committer | 2010-10-12 00:10:31 -0300 | |
commit | 4cf09312a1a9df7af2fd5458458fba3bd7aa5062 (patch) | |
tree | 58b72b25366692c4d456d210d5a2e50e25811bd3 | |
parent | updated ebuilds (diff) | |
download | g-octave-4cf09312a1a9df7af2fd5458458fba3bd7aa5062.tar.gz g-octave-4cf09312a1a9df7af2fd5458458fba3bd7aa5062.tar.bz2 g-octave-4cf09312a1a9df7af2fd5458458fba3bd7aa5062.zip |
fixed a bug when running g-octave from the source tarball or the git repo.
Thanks to Diego "Flameeyes" Pettenò by reporting.
-rw-r--r-- | g_octave/config.py | 20 |
1 files 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') |