1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-02-15 02:00:13 +03:00

Added new dictionary keys for mapping

This commit is contained in:
Valery Sinelnikov 2022-02-01 11:06:10 +04:00
parent b2c7144a0d
commit 0165167881

View File

@ -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