From 50188c88327faecfe2fea7aacb5c1881d2babff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 30 Jul 2013 11:37:33 +0200 Subject: [PATCH] Use relative path in system_path dict instead of path templates This will allow use of correct slashes/backslashes (os.path.join instead of hardcoded '/'). --- core/qubes.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/qubes.py b/core/qubes.py index 0fc2ebf5..af225f02 100755 --- a/core/qubes.py +++ b/core/qubes.py @@ -57,11 +57,12 @@ system_path = { 'qubes_base_dir': qubes_base_dir, - 'qubes_appvms_dir': '{base_dir}/appvms', - 'qubes_templates_dir': '{base_dir}/vm-templates', - 'qubes_servicevms_dir': '{base_dir}/servicevms', - 'qubes_store_filename': '{base_dir}/qubes.xml', - 'qubes_kernels_base_dir': '{base_dir}/vm-kernels', + # Relative to qubes_base_dir + 'qubes_appvms_dir': 'appvms', + 'qubes_templates_dir': 'vm-templates', + 'qubes_servicevms_dir': 'servicevms', + 'qubes_store_filename': 'qubes.xml', + 'qubes_kernels_base_dir': 'vm-kernels', # qubes_icon_dir is obsolete # use QIcon.fromTheme() where applicable @@ -881,8 +882,8 @@ except ImportError: pass for path_key in system_path.keys(): - system_path[path_key] = system_path[path_key].format( - base_dir=system_path['qubes_base_dir'] - ) + if not os.path.isabs(system_path[path_key]): + system_path[path_key] = os.path.join( + system_path['qubes_base_dir'], system_path[path_key]) # vim:sw=4:et: