mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2025-12-19 04:20:23 +01:00
Fix for config options containing HOME variable
This commit is contained in:
@@ -208,6 +208,9 @@ class Base(object):
|
|||||||
if val.startswith('/'):
|
if val.startswith('/'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if val.startswith('$HOME'):
|
||||||
|
continue
|
||||||
|
|
||||||
if val.startswith('$CONFIG'):
|
if val.startswith('$CONFIG'):
|
||||||
abspath = os.path.abspath(val.replace('$CONFIG', conf_abs_dir))
|
abspath = os.path.abspath(val.replace('$CONFIG', conf_abs_dir))
|
||||||
changed_options[key] = abspath
|
changed_options[key] = abspath
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ class TestBase(TestCase):
|
|||||||
bobj._normalize_options()
|
bobj._normalize_options()
|
||||||
self.assertDictEqual(bobj.fsuae_options, {'cdroms_dir': result})
|
self.assertDictEqual(bobj.fsuae_options, {'cdroms_dir': result})
|
||||||
|
|
||||||
|
get_config.return_value = {'cdroms_dir': '$HOME/path'}
|
||||||
|
bobj.fsuae_options = utils.CmdOption()
|
||||||
|
bobj._normalize_options()
|
||||||
|
self.assertDictEqual(bobj.fsuae_options, {})
|
||||||
|
|
||||||
def test_set_assets_paths(self):
|
def test_set_assets_paths(self):
|
||||||
|
|
||||||
bobj = base.Base('Config.fs-uae', utils.CmdOption(), {})
|
bobj = base.Base('Config.fs-uae', utils.CmdOption(), {})
|
||||||
|
|||||||
Reference in New Issue
Block a user