diff --git a/fs_uae_wrapper/base.py b/fs_uae_wrapper/base.py index d89e496..a4323ed 100644 --- a/fs_uae_wrapper/base.py +++ b/fs_uae_wrapper/base.py @@ -219,7 +219,11 @@ class Base(object): changed_options[key] = abspath continue - changed_options[key] = os.path.abspath(val) + _val = os.path.abspath(val) + if os.path.exists(_val): + changed_options[key] = _val + else: + changed_options[key] = val self.fsuae_options.update(changed_options) diff --git a/fs_uae_wrapper/utils.py b/fs_uae_wrapper/utils.py index 583687f..1e19dbc 100644 --- a/fs_uae_wrapper/utils.py +++ b/fs_uae_wrapper/utils.py @@ -144,6 +144,7 @@ def interpolate_variables(string, config_path, base=None): - $BASE """ + _string = string if '$CONFIG' in string: conf_path = os.path.dirname(os.path.abspath(config_path)) string = os.path.abspath(string.replace('$CONFIG', conf_path)) @@ -166,7 +167,9 @@ def interpolate_variables(string, config_path, base=None): if '$BASE' in string: string = string.replace('$BASE', base) - return string + if os.path.exists(string): + return string + return _string def get_config(conf_file):