Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #133 from joakim-hove/config-dict-assume-cwd
Browse files Browse the repository at this point in the history
Will assume cwd is CONFIG_DIRECTORY not set.
  • Loading branch information
joakim-hove authored Oct 4, 2017
2 parents f47a67d + b879664 commit 355f9c4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/python/res/enkf/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,21 @@ def _assert_keys(self, mother_key, exp_keys, keys):

def _extract_internals(self, config):
internal_config = []
config_dir = None
config_dir = os.getcwd()

if ConfigKeys.INTERNALS in config:
intercon = config[ConfigKeys.INTERNALS]

dir_key = ConfigKeys.CONFIG_DIRECTORY
if dir_key in intercon:
config_dir = os.path.realpath(intercon[dir_key])
internal_config.append((dir_key, config_dir))

internal_filter = [dir_key]
for key, value in intercon.iteritems():
if key not in internal_filter:
internal_config.append((key, self._parse_value(value)))

internal_config.append((ConfigKeys.CONFIG_DIRECTORY, config_dir))
return config_dir, internal_config


Expand Down Expand Up @@ -325,10 +325,6 @@ def _build_config_content(self, config):
config_content = ConfigContent(None)
config_content.setParser(config_parser)

if config_dir is None:
raise ValueError("Expected config to specify %s"
% ConfigKeys.CONFIG_DIRECTORY)

# Insert defines
for key in defines:
config_content.add_define(key, defines[key])
Expand Down

0 comments on commit 355f9c4

Please sign in to comment.