mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2026-01-23 07:25:48 +01:00
Fix for interpolate_variables function
This commit is contained in:
@@ -195,7 +195,6 @@ class Base(object):
|
||||
for num in range(10):
|
||||
include_list.append('hard_drive_%d' % num)
|
||||
|
||||
conf_abs_dir = os.path.dirname(os.path.abspath(self.conf_file))
|
||||
changed_options = {}
|
||||
|
||||
for key, val in utils.get_config(self.conf_file).items():
|
||||
@@ -212,7 +211,7 @@ class Base(object):
|
||||
continue
|
||||
|
||||
if val.startswith('$CONFIG'):
|
||||
abspath = os.path.abspath(val.replace('$CONFIG', conf_abs_dir))
|
||||
abspath = utils.interpolate_variables(val, self.conf_file)
|
||||
changed_options[key] = abspath
|
||||
continue
|
||||
|
||||
|
||||
@@ -145,8 +145,9 @@ def interpolate_variables(string, config_path, base=None):
|
||||
"""
|
||||
|
||||
if '$CONFIG' in string:
|
||||
string = string.replace('$CONFIG',
|
||||
os.path.dirname(os.path.abspath(config_path)))
|
||||
conf_path = os.path.dirname(os.path.abspath(config_path))
|
||||
string = os.path.abspath(string.replace('$CONFIG', conf_path))
|
||||
|
||||
if '$HOME' in string:
|
||||
string = string.replace('$HOME', os.path.expandvars('$HOME'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user