From 0165167881b7601dc9b79d4269f42a45814392bb Mon Sep 17 00:00:00 2001 From: Valery Sinelnikov Date: Tue, 1 Feb 2022 11:06:10 +0400 Subject: [PATCH] Added new dictionary keys for mapping --- gpoa/util/windows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpoa/util/windows.py b/gpoa/util/windows.py index 4bbcc5a..200fd0b 100644 --- a/gpoa/util/windows.py +++ b/gpoa/util/windows.py @@ -198,6 +198,8 @@ def expand_windows_var(text, username=None): ''' variables = dict() variables['HOME'] = '/etc/skel' + variables['HOMEPATH'] = '/etc/skel' + variables['HOMEDRIVE'] = '/' variables['SystemRoot'] = '/' variables['StartMenuDir'] = '/usr/share/applications' variables['SystemDrive'] = '/' @@ -206,13 +208,14 @@ def expand_windows_var(text, username=None): if username: variables['LogonUser'] = username variables['HOME'] = get_homedir(username) + variables['HOMEPATH'] = get_homedir(username) variables['StartMenuDir'] = os.path.join( variables['HOME'], '.local', 'share', 'applications') result = text for var in variables.keys(): - result = result.replace('%{}%'.format(var), variables[var]) + result = result.replace('%{}%'.format(var), variables[var]).replace('/', '//') return result