Skip to content

Commit

Permalink
add new env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed May 19, 2017
1 parent 2295701 commit 785dd7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Windows/laZagne.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ def set_env_variables(user = getpass.getuser(), toImpersonate = False):
constant.profile['HOMEPATH'] = os.environ.get('HOMEPATH', 'C:\\Users\\%s' % user)
constant.profile['ALLUSERSPROFILE'] = os.environ.get('ALLUSERSPROFILE', 'C:\\ProgramData')
constant.profile['COMPOSER_HOME'] = os.environ.get('COMPOSER_HOME', 'C:\\Users\\%s\\AppData\\Roaming\\Composer\\' % user)
constant.profile['LOCALAPPDATA'] = os.environ.get('LOCALAPPDATA', 'C:\\Users\\%s\\AppData\\Local' % user)
else:
constant.profile['APPDATA'] = 'C:\\Users\\%s\\AppData\\Roaming\\' % user
constant.profile['USERPROFILE'] = 'C:\\Users\\%s\\' % user
constant.profile['HOMEPATH'] = 'C:\\Users\\%s' % user
constant.profile['COMPOSER_HOME'] = 'C:\\Users\\%s\\AppData\\Roaming\\Composer\\' % user
constant.profile['LOCALAPPDATA'] = 'C:\\Users\\%s\\AppData\\Local' % user

# Used to print help menu when an error occurs
class MyParser(argparse.ArgumentParser):
Expand Down
3 changes: 2 additions & 1 deletion Windows/lazagne/config/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class constant():
'HOMEDRIVE': '',
'HOMEPATH': '',
'ALLUSERSPROFILE': '',
'COMPOSER_HOME': ''
'COMPOSER_HOME': '',
'LOCALAPPDATA': ''
}
username = ''

Expand Down
4 changes: 2 additions & 2 deletions Windows/lazagne/softwares/sysadmin/rdpmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def parse_xml(self, setting):

def run(self, software_name = None):
settings = [
'%s\\Microsoft Corporation\\Remote Desktop Connection Manager\\RDCMan.settings' % os.environ.get('LocalAppData', ''),
'%s\\Microsoft\\Remote Desktop Connection Manager\\RDCMan.settings' % os.environ.get('LocalAppData', '')
'%s\\Microsoft Corporation\\Remote Desktop Connection Manager\\RDCMan.settings' % constant.profile['LOCALAPPDATA'],
'%s\\Microsoft\\Remote Desktop Connection Manager\\RDCMan.settings' % constant.profile['LOCALAPPDATA']
]

for setting in settings:
Expand Down

0 comments on commit 785dd7a

Please sign in to comment.